open(FILE, filename); for $i (0 .. $#LINES) { print FILE "$LINES[$i]"; } close(FILE);