Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: lexical vs. local file handles

by Your Mother (Archbishop)
on Apr 18, 2020 at 23:36 UTC ( [id://11115756]=note: print w/replies, xml ) Need Help??


in reply to lexical vs. local file handles

FWIW there is a school of thought that considers braces around the { $filehandle } a best practice. I use it, inconsistently though–

print $fh, "something\n"; # …becomes… print { $fh }, "something\n"; # …which then tells you… syntax error at -e line 1, near "}," # …so you know to… print { $fh } "something\n";

Replies are listed 'Best First'.
Re^2: lexical vs. local file handles
by jo37 (Deacon) on Apr 19, 2020 at 07:54 UTC

    I like this and I'll try to use it.

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found