in reply to splitting a line into an array
or something more legible..my @fields = split /\s+/, $templine; # do something with $fields[0], $fields[4], etc ..
Another quick note: you can condense your code a lot -- iterate over the lines of the file instead of the indices: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 (<FILE>) { chomp; if (/\bdbweb./) { # do stuff with $_ now } } close(FILE);
blokhead
|
|---|