in reply to Printing first and last line

$ head -1 Sample_01.txt $ tail -1 Sample_01.txt
Sometimes the answer is to use the shell commands rather than try to recreate them in Perl. See Low Fat Linux for an example.

Update: Added link to head/tail documentation.

----
I Go Back to Sleep, Now.

OGB