in reply to Re^2: Question on "Effective Perl Programming" (;1 > $@)
in thread Question on "Effective Perl Programming"
package DESTROY::EVAL_ERROR::NOT; my %done; sub import { shift @_; for my $pkg ( @_ ) { next if $done{$pkg}++; $pkg .= "::DESTROY"; my $orig= \&{$pkg}; no warnings; *{$pkg}= sub { local $@; $orig->(@_) }; } }
Then:
use Broken::Package; use DESTROY::EVAL_ERROR::NOT qw( Broken::Package ); ...
In other words, "if I can't change EvalEater" need never be true. :)
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Question on "Effective Perl Programming" (intervene)
by Anonymous Monk on Sep 07, 2007 at 13:11 UTC | |
by girarde (Hermit) on Sep 08, 2007 at 21:03 UTC | |
by runrig (Abbot) on Sep 08, 2007 at 21:22 UTC | |
by kyle (Abbot) on Sep 08, 2007 at 21:39 UTC | |
by tye (Sage) on Sep 08, 2007 at 23:03 UTC |