Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Loop controls transcends scope?by TGI (Parson) |
on Jan 15, 2009 at 21:39 UTC ( [id://736682]=note: print w/replies, xml ) | Need Help?? |
If you decide Corion's excellent advice and enable warnings for your code while body of the code intact, you can suppress this warning easily.
My personal preference is to use something more like this:
The downside of this is the extra function call. The upside is that it's (hopefully) easier to read and maintain. I like to collect code with side-effects (like printing) into as few places as possible, so my format_stuff routine preps the data for output but does not emit it. I know this is a toy example, but the habit has served me well.
In Section
Seekers of Perl Wisdom
|
|