Perl-Sensitive Sunglasses | |
PerlMonks |
Heredoc Inconsistency: Bareword Filehandle vs Lexical Filehandleby roho (Bishop) |
on Jun 09, 2022 at 19:45 UTC ( [id://11144614]=perlquestion: print w/replies, xml ) | Need Help?? |
roho has asked for the wisdom of the Perl Monks concerning the following question:
I have not used bareword filehandles since lexical filehandles were made available. While upgrading a Perl program from bareword filehandles to lexical filehandles I noticed an inconsistency using heredocs. Bareword filehandles in heredocs work fine with a space following the "<<", but lexical filehandles in heredocs generate an error with a space following the "<<".
Since bareword filehandles are due to be deprecated, this may not be a pressing issue. I'm posting this so that others who may run into the same situation do not have to spend the debugging time tracking down this inconsistency. The following code shows the inconsistency:
"It's not how hard you work, it's how much you get done."
Back to
Seekers of Perl Wisdom
|
|