in reply to Re: curly braces around a lexical file handle
in thread curly braces around a lexical file handle
In your case, the curly braces are optional.
This is also a PBP-ism (#136). The general idea is always to do things in the same way even when unnecessary so no extra thought is needed (and no risk of forgetting is run) when it is necessary to do them in an unusual way.
E.g., if you always write
print {$filehandle} $some_data;
even when you don't have to, no extra thought is needed when it comes time to write
print {$hashref->{other}{handle}} $other_data;
instead.
Whether or not this approach is warranted in all cases is the subject of some debate.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: curly braces around a lexical file handle
by ikegami (Patriarch) on May 31, 2010 at 04:08 UTC |