Callback::Frame

Preserve error handlers and "local" variables across callbacks
Download

Callback::Frame Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Doug Hoyte
  • Publisher web site:
  • http://www.hcsw.org

Callback::Frame Tags


Callback::Frame Description

The problem that the Callback::Frame module solves is that although closures preserve their lexical environment, they don't preserve their dynamic environment.SYNOPSIS use Callback::Frame; my $callback; frame(name => "base frame", code => sub { $callback = frame(name => "frame #1", code => sub { die "some error"; }); }, catch => sub { my $stack_trace = shift; print $stack_trace; ## Also, $@ is set to "some error at ..." } )->(); $callback->();This will print something like: some error at synopsis.pl line 9. ----- Callback::Frame stack-trace ----- synopsis.pl:10 - frame #1 synopsis.pl:17 - base frameProduct's homepage


Callback::Frame Related Software