perlquestion
Anonymous Monk
This is among the basics. I thought I am trying to read in the first line of a file, and then print it.
<code>
#!/usr/bin/perl -w
use strict;
open (FILEHANDLE, '<', 'some.file') or die "Can't open some.file for reading.\n";
<FILEHANDLE>;
print;
close FILEHANDLE;
</code>
That produces:
<code>
Use of uninitialized value $_ in print at ./file.pl line 6, <FILEHANDLE> line 1.
</code>
What am I not understanding?
14