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 $_; }
In reply to Re: Loop through array or filehandle
by RichardK
in thread Loop through array or filehandle
by markdibley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |