in reply to adding a line to the beginning of a file

No need to use Perl:
% echo "See spot run" > newfile % cat origfile >> newfile % mv newfile origfile
Voila!