in reply to File names with interpolated variables

The following will edit all the files OUT1 through OUT100. I'm not sure if that's what you wanted, though - your request was a bit unclear.
$filename = 'OUT'; $max = 100; my ($fname, $ext) = split(/\./, $filename, 2); $ext = '.' . $ext if ($ext); my @temp; for (my $i = 1; $i <= $max; $i++) { if (!open(IN, "$fname$i$ext")) { print "Can't open $fname$i$ext fo +r read.<br>\n"; } else { @temp = <IN>; close(IN); # Do whatever editing is necessary on file data... if (!open(OUT, ">$fname$i$ext")) { print "Can't open $fname$i$ +ext for write.<br>\n"; } else { print OUT @temp; close(OUT); } } }