in reply to Re: How To Do This Better?
in thread How To Do This Better?
As your original seems to give up at the first newline. Plus, you have to remember that perl compiles regular expressions to make them run faster, particularily when they don't require backtracking (basically creates a finite state machine to do the job). As these are executed in C, writing perl to do the same job is *always* going to be slower.while(!eof(FILE)) { my $c = getc(FILE); $count{lc($c)}++ if $c=~/[a-zA-Z]/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Re: How To Do This Better?
by NoTwoGroo (Initiate) on Apr 15, 2000 at 01:12 UTC |