my @fields = split /\s+/, $templine; # do something with $fields[0], $fields[4], etc .. #### my %record; @record{qw/group ac g f start end time mb files l kb/} = split /\s+/, $templine; # do something with $record{group}, $record{f}, $record{end}, etc.. #### use strict; # hint hint my $file = 'c:\somepath\somefilename'; open (FILE, "<$file") or die "Cannot open $file for read :$!"; foreach () { chomp; if (/\bdbweb./) { # do stuff with $_ now } } close(FILE);