Help for this page

Select Code to Download


  1. or download this
    while ($text =~ m/.../g) {
      ...
    }
    
  2. or download this
    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)