Help for this page

Select Code to Download


  1. or download this
    $_ = 'abcdefghijk';
    my($left) =1;
    ...
    else{
      /gh(..)jk/};
    print "Caught $1\n"
    
  2. or download this
    $_ = 'abcdefghijk';
    my($left, $var) =1;
    ...
    else{
      ($var) = /gh(..)jk/};
    print "Caught $var\n"
    
  3. or download this
    $_ = 'abcdefghijk';
    my($left) =1;
    
    $left ? /ab(..)ef/ : /gh(..)jk/;
    print "Caught $1\n"
    
  4. or download this
    $verbtest ? /$verbpat/ :
       $nountest ? /$nounpat/ :
       $preptest ? /$preppat/ :
       die 'No catch on $_';
    $catch = $4;