Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to use __DATA__ efficiently, help!

by shawnhcorey (Friar)
on Feb 09, 2011 at 19:50 UTC ( [id://887264]=note: print w/replies, xml ) Need Help??


in reply to How to use __DATA__ efficiently, help!

my $data = '';  # set to the empty string
do{ $data = $data . $_ } while (<DATA>);
Always initialize your variables.
  • Comment on Re: How to use __DATA__ efficiently, help!

Replies are listed 'Best First'.
Re^2: How to use __DATA__ efficiently, help!
by Anonyrnous Monk (Hermit) on Feb 09, 2011 at 20:10 UTC

    Actually, that wouldn't help here, as it's not the undefined $data that Perl is complaining about, but the undefined $_.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://887264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found