in reply to Re^2: Deleting first and last lines of a text file
in thread Deleting first and last TWO(2) lines of a text file

Hmm, that should... and is, in fact, working for me. Are you sure there's not simply an empty line at the end of your input file? Perhaps you could share some sample data.

Also, why the open calls? If you want the output to go to a specific file, it'd be easier to simply redirect the script's output on the command line, like so:

$ ./scriptname srcfile.txt >jjl.exec.txt

Alternatively, I'd suggest at least using a different filehandle than STDOUT, though you'd of course have to adjust the print statement to print to that filehandle then. opening STDOUT like that apparently works, but it's giving me the heebies.