KStowe has asked for the wisdom of the Perl Monks concerning the following question:
I now need it to get a running total of ";" occurances while skipping the "; End" occurances within the files. Can I continue to use the tr/// operator or should I switch to the sub? Thanks so much.use strict; my @files = qw(FILES); my $semi_count; foreach my $file (@files) { open FILE, $file or die "Can't open $file: $!\n"; $semi_count += tr /;// for <FILE>; close FILE; } print $semi_count;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Exempting through search
by tye (Sage) on Jul 26, 2001 at 01:31 UTC | |
by KStowe (Novice) on Jul 26, 2001 at 01:34 UTC | |
|
Re: Exempting through search
by bikeNomad (Priest) on Jul 26, 2001 at 01:05 UTC |