Help for this page

Select Code to Download


  1. or download this
    @allmatches = $text =~ m/foo(.*?)bar/g;
    for ( @allmatches ) {
        print "dollarunderscore= $_ \tdollarone= $1\n";
    }
    
  2. or download this
    while ($text =~ m/foo(.*?)bar/g) {
        print "dollarunderscore= $_ \tdollarone= $1\n";
    }
    
  3. or download this
    $text =~ m/foo(.*?)bar/g; print "$_ \t$1\n";
    $text =~ m/foo(.*?)bar/g; print "$_ \t$1\n";
    $text =~ m/foo(.*?)bar/g; print "$_ \t$1\n";
    #[... repeated as often as necessary ...]