4. 異なる種類のハンドルの
共有はエラーに
# 5.26 まで
open my $hd, '<', 'foo.txt';
opendir $hd, 'bar/';
say <$hd>; # foo.txt の中身が出力される
say readdir $hd; # bar ディレクトリ配下のファイル一覧
# 5.28
Cannot open $hd as a dirhandle: it is already open
as a filehandle
5. ヒアドキュメントの終端
は省略不可に
print <<''; # OK
Empty string terminator is valid.
print <<""; # OK
Empty $string terminator is also valid.
# 5.28
print <<; # NG
This has long been deprecated since 5.000.
Use of bare << to mean <<"" is forbidden
6. 関数呼び出しで継承元の
AUTOLOAD が呼ばれるとエラーに
package A;
our @AUTOLOAD;
sub AUTOLOAD { ... }
package main;
A::foo(); # OK
package A;
@ISA = qw/B/;
package B;
our @AUTOLOAD;
sub AUTOLOAD { ... }
package main;
A::foo();
# Use of inherited AUTOLOAD
for non-method A::foo() is no
longer allowed
17. 古いパッケージセパレー
タに関する警告
my $name = 'Foo';
say "In $name's house...";
Use of uninitialized value $name::s in
concatenation (.) or string
18. 古いパッケージセパレー
タに関する警告
my $name = 'Foo';
say "In $name's house...";
# 5.28 では新しい警告が追加
Old package separator used in string
(Did you mean "$name's" instead?)
Use of uninitialized value $name::s in
concatenation (.) or string