while (s/this/that/g) { push @matches, $&; } #### while (s/this/that/gp) { push @matches, ${^MATCH}; }