#!/usr/bin/perl use warnings; use strict; open (FOO, "test") || die "ERROR Unable to open test: $!\n"; my @array = ; close FOO; my $first = shift (@array); my $last = pop (@array);