#!/perl/bin/perl use strict; use warnings; open (FILE, '<', 'sample.txt') or die "Could not open sample.txt: $!"; while () { ....????? } close (FILE) or die "Could not close sample.txt: $!";