in reply to split into hash
while (<THATFILE>){ s/^(\d+): /$1,/; # convert first field seperator from ': ' to ' +,' my @fields = split /,/; next unless $fields[3] == 987; my ($hr, $min, $sec) = split /:/, $fields[1]; # do something with time here }
I think that makes the code clearer and I doubt any-one would look at the source data and miscount the fields, the comment would be mandatory however.
my $chainsaw = 'Perl';
|
|---|