in reply to How to delete a particular line in a text file after some operation on that text file at the same time
I suggest you use module Tie::File. It allows you to treat the file just like an array, so adding, editing and removing lines is as easy as array operations.
use strict; use warnings; use Tie::File; tie my @lines, 'Tie::File, 'ListOfIpAdress.txt' or die "$!"; # define sub F such that it returns 0 if Time > 34, 1 otherwise @lines = grep { F($_) } @lines; untie @lines;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to delete a particular line in a text file after some operation on that text file at the same time
by ppp (Acolyte) on Jan 18, 2015 at 07:11 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 18, 2015 at 07:35 UTC | |
by GotToBTru (Prior) on Jan 19, 2015 at 19:44 UTC |