foreach (@file) { $count++; s/^/$count. /; print FILE; }