I thought in the edited file one could add headers in the CHECK or BEGIN stage and trailers END stage of execution.
That would have been a nice feature, hm?
It prevents checking for $.==1 or eof in every line.
OT:
After experimenting a little with the -i switch I found a nice obfuscated way of deleting files. ;-)
#!/usr/bin/perl -Xi
# usage $0 file_a file_b ...
while(<>){}