In the name of Tim Toady (There Is More Than One Way To Do It). Featuring the range, or flip-flop operator, which translates in human as "From .. till ..", and the next keyword.
my $count =0;
next LINE unless /^E/../^G/; # next line unless we are between a li
+ne starting with a end a line starting with G
die "Oups, went too far!" if /^h/; # error if the line starts with
+an h and hasn't been skipped by the previous statment
$count++ unless /^G/; # count that do not start with a G