$ cat file.txt line one line two line three $ cat open_and_read.pl #!/usr/bin/perl -w use strict; # usually one does not put a $ on a filehandle variable open ( MYFILE, " ) { print $line; } close ( MYFILE ); $ ./open_and_read.pl line one line two line three