Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: About text file parsing

by davido (Cardinal)
on Aug 29, 2018 at 18:45 UTC ( #1221322=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -e 'open my $outfh, ">", "sample.txt"; while ($i++ < 50_000_000) 
    +{print $outfh "abcdefghijklmnopqrstuvwxyz0123456789\n";}'
    
  2. or download this
    perl -E 'open my $infh, "<", "sample.txt"; while(<$infh>) {$i++} say $
    +i;'
    
  3. or download this
    my %dispatch = (
        sample =>  sub {my $capture = shift; # do something with $capture}
    +,
    ...
            $dispatch{$1}->($2);
        }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1221322]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2020-12-02 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (41 votes). Check out past polls.

    Notices?