in reply to Re: Redirection within a Perl script
in thread Redirection within a Perl script

... you might want to use this reverse dispatch method...

I agree with the "hash-of-subrefs as dispatch table" recommendation, but the trinary operator is overkill here -- we don't have to worry about catching the "exists but false case" so a regular alternation would be enough:

( $hash{$funct} || \&some_default )->();