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 (Curate) 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$