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 (Vicar)
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 web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-14 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (254 votes), past polls