Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Loop through array or filehandle

by RichardK (Parson)
on Sep 29, 2016 at 14:13 UTC ( [id://1172932]=note: print w/replies, xml ) Need Help??


in reply to Loop through array or filehandle

You can open a file handle on the string directly, see open

for example :-

use v5.22; use warnings; use autodie; my $mydata = "this\nthat\n"; open (my $fh, '<' , \$mydata); while (<$fh>) { print $_; }

Log In?
Username:
Password:

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

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

    No recent polls found