in reply to Cannot print line
open my $in_fh, '<', '/home/nikl123/indri-5.6/runquery/trec7_4collecti +ons.txt' or die $!; print scalar <$in_fh>;
This will open a file and print the first line. You don't need a loop to read the first line of a file, and you don't need to split on newlines if you only read one line. In fact, you don't even need to print a newline explicitly, as each line of a file will end in one, except for the last line (unless the first line is the last line).
Or how about this?
use IO::All; print io('/home/nikl123/indri-5.6/runquery/trec7_4collections.txt')->g +etline;
Dave
|
|---|