while ( <> ) { print "$string_1 matched ", scalar @list_1, "times." if @list_1 = $_~ /regex_1/g; print "$string_2 matched ", scalar @list_2, "times." if @list_2 = $_=~ /regex_1/g; }