in reply to RFC: Acme::ExceptionEater
Why not take arguments in your use statement, and then inject an exception eating DESTROY method into any listed classes. Just pervert the code tye posted in response to you, et viola!
package Acme::ExceptionEater; my %done; sub import { shift @_; for my $pkg ( @_ ) { next if $done{$pkg}++; $pkg .= "::DESTROY"; my $orig= \&{$pkg}; no warnings; *{$pkg}= sub { $orig->(@_); eval{}; } } }
Warning: This is a totally untested copy/paste/perversion of tye's code.
Assuming I didn't break it, then you can do:
use Happy::Friendly::Package; use Acme::ExceptionEater qw( Happy::Friendly::Package );
And you too will have mysteriously silent failures in your code!
TGI says moo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Acme::ExceptionEater
by kyle (Abbot) on Sep 08, 2007 at 02:27 UTC | |
by girarde (Hermit) on Sep 10, 2007 at 15:04 UTC | |
|
Re^2: RFC: Acme::ExceptionEater
by itub (Priest) on Sep 11, 2007 at 13:50 UTC | |
by TGI (Parson) on Sep 11, 2007 at 16:55 UTC | |
by tye (Sage) on Sep 11, 2007 at 17:21 UTC | |
by TGI (Parson) on Sep 11, 2007 at 18:06 UTC | |
by tye (Sage) on Sep 11, 2007 at 18:21 UTC | |
by kyle (Abbot) on Sep 11, 2007 at 17:29 UTC | |
|
Re^2: RFC: Acme::ExceptionEater
by samizdat (Vicar) on Sep 10, 2007 at 12:39 UTC |