Help for this page

Select Code to Download


  1. or download this
    $str = 'Nothing but perl can parse Perl';
    
    ...
    
    print($str =~ /perl/i ?1:0,"\n");      # Prints '1'
    print($str =~ /noth/i ?1:0,"\n");      # Prints '1'
    
  2. or download this
    $str = 'Nothing but perl can parse Perl';
    
    ...
    while (/perl/i) {
       # Loops forever
    }
    
  3. or download this
    my @matches = ($g ? /$re/g : /$re/);
    
  4. or download this
    for (...) {
       my ($re, $g) = @$_;
       my @matches = ($g ? /$re/g : /$re/);
       ...
    }
    
  5. or download this
    >perl -le"print qr/.../s"
    (?s-xim:...)