してはいけない書き方

  • 配列に対してdeleteを使う
    • 要素は消えないし、perl-5.12.1 のperldoc perlfunc より”非推奨”
use strict;
use warnings;
my @list = qw( a b c d e );
delete($list[1]);
print "@list\n";
__END__
Use of uninitialized value in join or string at a.pl line 5.
a  c d e
  • my と if を同時に使う
    • これもperldoc perlsynより動作は”未定義”
use strict;
use warnings;
my $aa=1;
my $bb = 2 if $aa;
print "$aa $bb\n";
__END__
1 2