- $a
- $b
-
Special package variables when using
sort(), see "sort" in perlfunc. Because of this specialness$aand$bdon't need to be declared (usinguse vars, orour()) even when using thestrict 'vars'pragma. Don't lexicalize them withmy $aormy $bif you want to be able to use them in thesort()comparison block or function.sort()を使うときの特殊パッケージ変数です; "sort" in perlfunc を 参照してください。 この特殊性により、$aと$bは、たとえstrict 'vars'プラグマを 使っているときでも (use varsやour()を使って) 宣言する必要が ありません。 これをsort()比較ブロックや関数で使えるようにしたい場合は、my $aやmy $bとしてレキシカル化しないでください。