Alternate with "missing file" protection.
#!/usr/bin/perl use strict; use warnings; use Path::Tiny; my $delroad = 'Some Road Name'; my $delnumber = 123; for my $file ( qw( file1 file2 ... file3 ) ) # your filenames here { eval { path($file)->edit_lines( sub { my @field = split /:|\n/; $field[1] eq $delroad && $field[2] == $delnumber and $_ = ''; } ); 1; } or print $@; }
In reply to Re: Delete Lines Across Multiple Files
by tybalt89
in thread Delete Lines Across Multiple Files
by PilotinControl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |