in reply to Re: Creating dispatch table with variable in function name
in thread Creating dispatch table with variable in function name

Ugh, forgot the ->() bit to actually call the function. The sub { "DUMMY" } output when printing the variable was also throwing me off.

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

Replies are listed 'Best First'.
Re^3: Creating dispatch table with variable in function name
by choroba (Cardinal) on Nov 23, 2017 at 10:07 UTC
    Uf the sub { "DUMMY" } came from Data::Dumper, you can tell it to show the code by turning Deparse on:
    use Data::Dumper; $Data::Dumper::Deparse = 1; print Dumper(sub { $_[0] . $_[1] });

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,