use Tie::File; tie @f, 'Tie::File', "file.txt" or die $!; foreach (@f[1..$#f]) { print $_, "\n"; }