Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Counting lines as I write them...

by fglock (Vicar)
on Apr 11, 2005 at 14:32 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-16 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found