Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by Laurent_R (Parson)
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 drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-12-27 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls