#!/usr/bin/perl # Note: file random.txt must be in same directory, or else # must specify an absolute path open(TXT, "; # get the first line (note scalar) close(TXT); # close file again print "The first line of the file is: $line\n";