use strict; open FILE, "; shift @lines; pop @lines; # @lines now contains the file contents without the first and last lines.