in reply to replacing text in multiple files

It sounds like you'd be fine with processing them one at a time, not all at once. In that case, just wrap your while loop in another loop that goes through the files:

my @files = qw( /path/to/file1 /path/to/file2 /path/to/file3 ); for my $file (@files){ open my $fd, '<', $file or die $!; while(my $line = <$fd>){ # do stuff with the next line } close $fd; }

Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.