Help for this page
while ($text =~ m/.../g) { ... }
my $text = "aaa"; while ($text =~ m/a/g) { last } # only executes once ... # $text .= ''; # another way to do it print "matched\n" if ($text =~ m/aaa/g)