in reply to File Search And Compare
# create variables: # $pattern - pattern for regular expression # %parsed - hash, keys are lines containing pattern, # values are counter of times seen # $i - counter of total lines matching pattern my $pattern = 'fwa'; my (%parsed, $i); while(<$FILE>){ # read line from filehandle, assign to special variable $_ if(/$pattern/i && $i++) { chomp $_; # remove newline @new=split(/:[01-60] /,$_); $_=$new[1]; $parsed{ $_ }++; # use line as hash ect ect ect.......
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File Search And Compare
by particle (Vicar) on Feb 18, 2002 at 22:36 UTC |