{ my @stmterrs; } DDL_stmtlist: DDL_statement(s? /;/) { if (@stmterrs) { push(@{$thisparser->{errors}}, @stmterrs); undef; } else { 1; } } DDL_statement: whatever | { push(@stmterrs, ["something fishy", $thisline]); }