Help for this page

Select Code to Download


  1. or download this
    sub func {
       'b' =~ /(.)/;
    ...
    
    'a' =~ /(.)/;  func($1);    # Prints "b"
    'a' =~ /(.)/;  func("$1");  # Prints "a"
    
  2. or download this
    sub func {
       eval { die "bar\n" };
    ...
    
    eval { die "foo\n" };  func($@);    # Prints "bar"
    eval { die "foo\n" };  func("$@");  # Prints "foo"