in reply to Single line insert to the start of a file

Use -p flag to run your code in the loop:
LINE: while (<>) { ... # your program goes here } continue { print or die "-p destination: $!\n"; }
and -i flag to edit files in-place (see perlrun for more). Use $. to check the line number. Define BEGIN{} to read the header, then write it in the main loop:
perl -pi -e'BEGIN{$HEAD=shift@ARGV;open(HEAD);$main::head=<HEAD>}$_=$m +ain::head.$_ if $.==1' header-file file-to-be-edited
Perhaps avoiding the -p will be more efficient, but not so compact:
perl -e'($HEAD,$FILE)=@ARGV;open(HEAD);open(FILE);open($f,">$FILE.$$") +;print $f scalar <HEAD>,<FILE>;rename "$FILE.$$","$FILE"' header-file + file-to-be-edited
Warning: both of the one-liners use somewhat deprecated one-argument open and barewords as filehandles.
Sorry if my advice was wrong.