##
my @matches = ( $inp_line =~ /(SHAPES \w+;(?:SIZE[ \d+])+;)/g );
####
my @matches;
for ( @inp_lines ) {
push @matches, ( /(SHAPES \w+;(?:SIZE[ \d+])+;)/g );
}
####
s/(?<=\d;)(?=SHAPES )/\n/; # using "look-behind" and "look-ahead
# now just split on "\n"...