|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: How to use __DATA__ efficiently, help!by Anonyrnous Monk (Hermit) |
| on Feb 09, 2011 at 19:14 UTC ( #887254=note: print w/ replies, xml ) | Need Help?? |
|
You get the "uninitialized value" warning because the do {...} executes once before a value is being assigned to $_. Just turn it around:
BTW, note that $data .= "foo" (or $data = $data . "foo" for that matter) is a special case that does not generate an "uninitialzed value" warning, even if $data is undefined initially:
while this does, of course:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||