my @triplets = unpack("x${skip}(a3)*", $line); pop @triplets if $triplets[-1] !~ /.../;