Help for this page

Select Code to Download


  1. or download this
     
    use warnings;
    use strict;
    $_ = '1: A silly sentence (495,a) *BUT* one which will be useful. (3)'
    +;
    my $pattern = <STDIN>;
    
  2. or download this
    if (/$pattern/){
    
  3. or download this
     
      print "words $pattern\n";
      print "\$1 morewords\n";
      print "\$2 morewords\n";
      print "\$seewhereimgoing\n";
    }
    
  4. or download this
    if /$pattern/{
      print "$$i\n";
      $i++;
    }
    
  5. or download this
    $_ = '1: A silly sentence (495,a) *BUT* one which will be useful. (3)'
    +;
    
    print "Enter a regular expression: ";
    ...
            print "$i: $matches[$i]\n";
        }
    }
    
  6. or download this
    Enter a regular expression: ([a-z]+?)(.*?)([a-z]+?) 
    0: s
    ...
    3. 
    Use of unitialized value in concatenation (.) or string at exp3.pl lin
    +e 14, <STDIN> line 1.
    4: