Help for this page

Select Code to Download


  1. or download this
    for (qw{dog pig cat horse}) {
        /.o${print "$_ gets printed\n";\''}/ and print "$_ matched\n";
    ...
    cat gets printed
    horse gets printed
    horse matched
    
  2. or download this
    for (qw{dog pig cat horse}) {
        /.o(?{print "$_ gets printed\n"})/ and print "$_ matched\n";
    ...
    dog matched
    horse gets printed
    horse matched
    
  3. or download this
    for (qw{dog pig cat horse}) {
        /.o(??{print "$_ gets printed\n"; 'g'})/ and print "$_ matched\n";
    ...
    dog gets printed
    dog matched
    horse gets printed