Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2016-12-02 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (50 votes). Check out past polls.