in reply to adding a line to the beginning of a file
This is a FAQ.
use Tie::File; tie my @lines, 'Tie::File', 'myfile.txt' or die 'tie failed'; unshift @lines, "a new line\n"; untie @lines; [download]
the lowliest monk