Skip to content

Commit

Permalink
perldelta f2d6099: no "bareword_filehandles" and class barewords
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed Feb 21, 2024
1 parent f2d6099 commit e78bf41
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,46 @@ XXX For a release on a stable branch, this section aspires to be:

[ List each incompatible change as a =head2 entry ]

=head2 Class barewords no longer resolved as file handles in method calls under C<no feature "bareword_filehandles">

Under C<no feature "bareword_filehandles"> bareword file handles
continued to be resolved in method calls:

open FH, "<", $somefile or die;
no feature 'bareword_filehandles';
FH->binmode;

This has been fixed, so the:

FH->binmode;

will attempt to resolve C<FH> as a class, typically resulting in a
runtime error.

The standard file handles such as C<STDOUT> continue to be resolved as
a handle:

no feature 'bareword_filehandles';
STDOUT->flush; # continues to work

Note that once perl resolves a bareword name as a class it will
continue to do so:

package SomeClass {
sub somemethod{}
}
open SomeClass, "<", "somefile" or die;
# SomeClass resolved as a handle
SomeClass->binmode;
{
no feature "bareword_filehandles";
SomeClass->somemethod;
}
# SomeClass resolved as a class
SomeClass->binmode;

[github #19426]

=head1 Deprecations

XXX Any deprecated features, syntax, modules etc. should be listed here.
Expand Down

0 comments on commit e78bf41

Please sign in to comment.