in reply to calling a sub routine from a scalar

The best solution in this case is:

use Carp qw( carp croak ); my %actions= ( die => sub { die @_ }, warn => sub { warn @_ }, carp => \&carp, croak => \&croak, ); # ... $actions{$exception->{action}}->( ... );
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")

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
    I can't believe I didn't think of that. It works great. Thank you!
Re: (tye)Re: calling a sub routine from a scalar
by suaveant (Parson) on May 16, 2001 at 22:18 UTC
    Yes, this is much better too, as long as you have a manageable set of subroutines to call ++

                    - Ant