Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Wierd bugs I would have never expectedby Anonymous Monk |
on Dec 17, 2010 at 05:48 UTC ( [id://877590]=note: print w/replies, xml ) | Need Help?? |
The cause? a stray comma: print $fh, $sData instead of print $fh $sData.I catch myself making the same mistake, and I've begun to habitually use the form print {$filehandle} $payload; to notify both me and Perl what I really mean. I'm amazed at how quickly "print" followed by curly braces feels like a new sigil; and it really decreases the amount of time I spend examining such statements for intent, not to mention examining them for errors.
In Section
Meditations
|
|