in reply to Re: Should one treat method name as input?
in thread Should one treat method name as input?

The third solution is a good case for goto &sub:

sub common { my ($name, @args) = @_; print("This is $name\n"); } sub slurp {unshift(@_,"slurp"); goto &common} sub get {unshift(@_,"get"); goto &common} slurp; get; __END__ This is slurp This is get
This way if you carp() or croak() within common() you get better error message plus it's quicker.

Jenda
We'd like to help you learn to help yourself
Look around you, all you see are sympathetic eyes
Stroll around the grounds until you feel at home
   -- P. Simon in Mrs. Robinson