Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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;


Comment on Re: Counting lines as I write them...
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-07-24 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls