- or download this
$num_matches_stuff = $str =~ m/(stuff)/g;
@all_the_matches = $str =~ m/(stuff)/g;
- or download this
$str = "stuff stuff stuff";
$num_matches_stuff = $str =~ m/(stuff)/g;
print $num_matches_stuff;
- or download this
$str = "stuff stuff stuff";
while($str =~ m/(stuff)/g) {
print "Got one!\n";
}