On 12 April 2010 04:31, Uri Guttman <[email protected]> wrote:
>>>>>> "AM" == Abimael Martinez <[email protected]> writes:
>
> AM> print {$tmp} "$div_start";
>
> no need for the {} around a single scalar handle.
But it *does* comply with Perl Best Practices #136.
* It makes the filehandle obviously different from the other arguments
* It makes you less likely to accidentally put a wrong comma in:
print {$tmp}, $div_start;
* If you forget a comma on a print statement where you just meant to
print to STDOUT, it stands out as being wrong:
print $arg1 $arg2; # should have been print $arg1, $arg2; or print
{$arg1} $arg2
* IOW, it forces you to be more explicit about when you are printing
to a fh and when you are printing to STDOUT.
So there's at least 2 other people out there (Damian and me) who think
the OP's version is reasonable.
Phil
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/