{ last if $text =~ /\G \s* \Z/gcmsx; if ($text =~ /\G \s* ^ \s*/gcmsx) { if ($text =~ /\G module \s+ (\S+?) \s* \( \s* (.*?) \s* \) \s* ;/gcmsx) { $name = $1 } elsif ($text =~ /\G endmodule /gcmsx) { } elsif ($text =~ /\G \S+ \s+ .*? \s* ;/gcmsx) { } else { die "ERROR: unknown syntax\n" } } else { die "ERROR: unknown syntax\n" } redo; }