barewor...ehandles(3)
β¨ NAME β¨
bareword::filehandles β disables bareword filehandles. Thatβs the whole assignment, bestie. π
π VERSION π
version 0.007
π¦ SYNOPSIS π¦
Okay so you drop this into your code and the bareword-filehandle vibe check begins:
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 π
Real talk: this module lexically disables the use of bareword filehandles with builtin functions. The only exceptions β the special builtin filehandles that are still invited to the group chat β are STDIN, STDOUT, STDERR, ARGV, ARGVOUT and DATA. Iconic behavior, no cap. β¨
π METHODS π
π§ unimport
unimport disables bareword filehandles for the remainder of the scope being compiled. Itβs giving βturn the bareword filehandle switch off,β fr fr. π«Ά
π§ import
import enables bareword filehandles for the remainder of the scope being compiled. Yep, itβs the enable side. Slay. π
π LIMITATIONS π
Okay, tiny caveat, donβt come for me: 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. Thatβs the limitation, periodt. π
π₯ SEE ALSO π₯
perlfuncB::Hooks::OP::Check
π AUTHOR π
Dagfinn Ilmari MannsΓ₯ker <ilmari@ilmari.org> β iconic, obviously. π
π 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.
π
Thatβs the whole page, bestie. Shoutout to the footer crew: perl v5.32.1 and the date 2022-01-20 β manual page delivered, vibe included. Byeee! π«ΆπΈ
π¦ where this page comes from
- epel 9: perl-bareword-filehandles 0.007-10.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms