IN
is a filehandle
Preceding the filename is a redirection character.open(IN, ">test"); print IN "In we go"; close(IN);
There are many short cut features in Perl. In particular, there are a host 'special variables' like $_.$filename = $ARGV[0]; #get command line argument open(IN, "<$filename"); $line = <IN>; #read the first line print $line; while(<IN>) { #loop as long as not EOF print $_; #loop variable -- contains current line }