Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Counting lines as I write them...

by fglock (Vicar)
on Apr 11, 2005 at 14:32 UTC ( #446617=note: print w/replies, xml ) Need Help??

in reply to Counting lines as I write them...

use strict; my $filename = shift; open( INFILE, "<$filename" ) || die "$!\n"; open( OUTFILE, ">>dataload.errs" ) || die "$!\n"; my %count; my $line; while ( $line = <INFILE> ) { if ( $line =~ /^( \*{3}M | \!{3} | \@{3} )/x ) { $count{$1}++; print OUTFILE $line; } } close( INFILE ); close( OUTFILE ); print "Total errors for $_: $count{$_}\n" for keys %count;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://446617]
[Corion]: DST does that to everybody...
Corion attempts to find who to address to better target his drive-by patches
[Corion]: This time it's for the Duktape embedded Javascript engine, which would be nice to have IMO, but doesn't compile on Windows currently
[Corion]: I imagine it would be fun to have WWW::Mechanize:: Duktape, but I haven't seen a web browser written in Javascript yet, except the ones distributed with PhantomJs

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-27 11:07 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (319 votes). Check out past polls.