Help for this page

Select Code to Download


  1. or download this
    sub foo {
      if( $error ){
    ...
    }
    my $ret = foo();
    die "@$ret" if ref($ret) eq 'YouveGotError';
    
  2. or download this
    sub fortunecookie {
      my $cookie = ...;
    ...
      return \$cookie
    }
    # ok a bit awkward with the stringref but it demonstrates that one can
    + do this with scalars too