On 12 April 2010 04:31, Uri Guttman <u...@stemsystems.com> wrote:
>>>>>> "AM" == Abimael Martinez <abijr....@gmail.com> 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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to