in reply to One-liner only checking the first line of the input file
Are your line endings what you expect (ie. is the file being treated as one long line as opposed to several)? Try this, and see if you get a single line, or all of the lines printed:
perl -lane 'print $_; exit;' input.txt
In Section
Seekers of Perl Wisdom