Help for this page

Select Code to Download


  1. or download this
    use Test::More 'no_plan';
    use Test::Exception;
    
  2. or download this
    my $result;
    lives_ok {$result = $o->answer} 'answer worked';
    is $result, 42, 'answer returned 42';
    
  3. or download this
    is live{$o->answer}, 42, 'answer worked';
    
  4. or download this
    live
           Returns the result of the given expression if no
    ...
               unlike live {$o->foo}, '/fribble/', 'no fribble';
    
           Appropriate care must be taken.
    
  5. or download this
    use Sub::Uplevel;
    
    ...
        ) if $@;
        $value;
    };