Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by Laurent_R (Canon)
on Oct 06, 2013 at 08:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1057130]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found