#!/usr/bin/perl use warnings; use strict; open (FOO, "test") || die "ERROR Unable to open test: $!\n"; my $last; my $first = ; while () { $last = $_ } close FOO; print "\$first: $first"; print "\$last: $last";