- 460 名前:デフォルトの名無しさん mailto:sage [2019/09/15(日) 11:42:49.90 ID:4T3I9hnw.net]
- >>412 Prl5 (≦5.28)、配列の添字を0始まり以外にする$[ (array_base feature)を使用
$[ = 1; @a = a..z; @x = grep{$_ & 1} 1..@a; @b = @a[@x]; print "@b\n"; 実行結果 ~ $ perl 15_412_array_base.pl a c e g i k m o q s u w y ※5.12〜5.28では$[は非推奨になり、設定すると Use of assignment to $[ is deprecated at 15_412_2.pl line 1. というwarningが出ます、5.30からは$[の設定できなくなりました
|

|