Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

RE: Interpolating from text file

by Zarathustra (Beadle)
on Oct 05, 2000 at 02:20 UTC ( [id://35351]=note: print w/replies, xml ) Need Help??


in reply to Interpolating from text file

open(INFO,"artist.id"); while ( <INFO> ) { $info .= eval "\"$_\""; # or #push(@info, eval "\"$_\""); } close(INFO); print "info:\n$info"; #print "info:\n@info";

Those escaped quotes are required if you want to maintain the actual format
of the file - newlines, spaces and such.

update:Of course, you can use qq as in ctweten's example to make it
look a bit cleaner
while ( <INFO> ) { $info .= eval "qq($_)"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-19 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found