manpagez: man pages & more
man bareword::filehandles(3)
Home | html | info | man
bareword::filehandles(3)                   User Contributed Perl Documentation



NAME

       bareword::filehandles - disables bareword filehandles


VERSION

       version 0.007


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


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".


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.


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".


SEE ALSO

       perlfunc(1), B::Hooks::OP::Check(3).


AUTHOR

       Dagfinn Ilmari Mannsaker <ilmari@ilmari.org>


COPYRIGHT AND LICENSE

       This software is copyright (c) 2011 - 2016 by Dagfinn Ilmari Mannsaker.

       This is free software; you can redistribute it and/or modify it under
       the same terms as the Perl 5 programming language system itself.

perl v5.34.3                      2024-03-12          bareword::filehandles(3)

bareword-filehandles 0.7.0 - Generated Mon Aug 4 13:22:49 CDT 2025
© manpagez.com 2000-2025
Individual documents may contain additional copyright information.