Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Iterator to parse multiline string with \\n terminator

by Laurent_R (Abbot)
on Oct 06, 2013 at 08:58 UTC ( #1057130=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $fh = IO::File->new($filename, 'r');
    
    my $fh_iterator = sub {
    ...
    while (my $line = $fh_iterator->($fh)) {
        # do stuff to $line
    }
    
  2. or download this
    sub create_iterator{
       my $filename = shift;
    ...
    while (my $line = $fh_iterator->()) {
        # do stuff to $line
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057130]
help
Chatterbox?
and the rats come out to play...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-02-24 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (362 votes). Check out past polls.