Skip to content

andreasgudmundsson/p5-Devel-Unwind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imagine Perl had the ability to die to a labeled eval so that when
you write

  FOO: eval {...}

you could die to that labeled eval

  die FOO "bar";

That is essentially what Devel::Unwind gives you.
Two custom keywords 'mark','unwind' are added allowing
you two write

  use Devel::Unwind;

  mark FOO {...} or do {...}
  unwind FOO "bar";
  unwind FOO "bar","baz";
  unwind FOO (bless [], "Bar");
  unwind FOO;

Wherever you would put a block 'eval' an 'mark' expression can be
used.  And wherever you would 'die' you can 'unwind'. If a
$SIG{__DIE__} handler is installed then it gets called on
'unwind'. The arguments to 'unwind' are treated the same way as the
arguments to 'die'. Multiple arguments are joined to together, a single
argument is passed through untouched unless it is a object with
PROPAGATE method in which case $@ gets replaced by the return value of
that method. For details read the documentation of die.

About

Learning perl internals by making mistakes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •