bareword::filehandles

Section: User Contributed Perl Documentation (3pm)
Updated: 2022-10-20
Index Return to Main Contents
 

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, B::Hooks::OP::Check.  

AUTHOR

Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org>  

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 - 2016 by Dagfinn Ilmari Mannsåker.

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


 

Index

NAME
VERSION
SYNOPSIS
DESCRIPTION
METHODS
unimport
import
LIMITATIONS
SEE ALSO
AUTHOR
COPYRIGHT AND LICENSE

This document was created by man2html, using the manual pages.
Time: 16:08:32 GMT, April 26, 2024