I hope that helps.my $time = 50; while (<IN>){ @tmp_split = split /:/,$_; # Print the previous entry if valid print OUT "NAME:$tmp_hash{\"NAME\"}ID:$tmp_hash{\"ID\"}TIME:$tmp_hash{ +\"TIME\"}" if ($tmp_split[0] eq "NAME" && $tmp_hash{"TIME"} > $time); # Put the values in a hash for storage $tmp_hash{$tmp_split[0]}=$tmp_split[1]; } # Print the last entry if valid print OUT "NAME:$tmp_hash{\"NAME\"}ID:$tmp_hash{\"ID\"}TIME:$tmp_hash{ +\"TIME\"}" if ($tmp_hash{"TIME"} > $time);
In reply to Re: Deleting a line from a file
by c-era
in thread Deleting a line from a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |