in reply to Technique for building arguments from function name?

Corion's suggestion provides a function_* for every *. This one only creates the ones you list. Whatever works for you.
for my $x (qw( cat dog fish )) { no strict 'refs'; *{"function_$x"} = sub { print $x }; } function_cat(); # print "cat" function_banana(); # error

Replies are listed 'Best First'.
Re^2: Technique for building arguments from function name?
by nysus (Parson) on Dec 04, 2017 at 20:01 UTC

    Ah, nifty and easy. That could be just what I need. Thanks!

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks