http://qs321.pair.com?node_id=11126081


in reply to Delete Lines Across Multiple Files

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 $@; }