Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Loop through array or filehandle

by RichardK (Parson)
on Sep 29, 2016 at 14:13 UTC ( #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
Node Status?
node history
Node Type: note [id://1172932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2020-06-02 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (16 votes). Check out past polls.

    Notices?