in reply to calling a sub routine from a scalar
The best solution in this case is:
Note that I couldn't find a way to get \&die, \&CORE::die, etc. to work so I went with simple anonymous subs. - tye (but my friends call me "Tye")use Carp qw( carp croak ); my %actions= ( die => sub { die @_ }, warn => sub { warn @_ }, carp => \&carp, croak => \&croak, ); # ... $actions{$exception->{action}}->( ... );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: calling a sub routine from a scalar
by cmilfo (Hermit) on May 16, 2001 at 21:54 UTC | |
|
Re: (tye)Re: calling a sub routine from a scalar
by suaveant (Parson) on May 16, 2001 at 22:18 UTC |