logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

bareword::filehandles - disables bareword filehandles

Author

       Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>

Description

       This module lexically disables the use of bareword filehandles with builtin functions, except for the
       special builtin filehandles "STDIN", "STDOUT", "STDERR", "ARGV", "ARGVOUT" and "DATA".

Limitations

       Filetest operators ("-X") can not be checked on Perl versions before 5.32, because hooking the op check
       function for these breaks stacked tests, e.g. "-f -w -x $file".

Methods

unimport
       Disables bareword filehandles for the remainder of the scope being compiled.

   import
       Enables bareword filehandles for the remainder of the scope being compiled.

Name

       bareword::filehandles - disables bareword filehandles

See Also

       perlfunc, B::Hooks::OP::Check.

Synopsis

           no bareword::filehandles;

           open FH, $file            # dies
           open my $fh, $file;       # doesn't die

           print FH $string          # dies
           print STDERR $string      # doesn't die

Version

       version 0.007

See Also