# 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.......