in reply to printing a package result within quotes
As you can see this is not very nice, so I'd go with these friendler solutionsmy $f = sub { return 'a sub' }; print "\$f is ${\$f->()}\n"; __output__ $f is a sub
my $f = sub { return 'a sub' }; # list print "\$f is ", $f->(), "\n"; # concat print "\$f is ". $f->(). "\n"; # save return my $ret = $f->(); print "\$f is $ret\n";
_________
broquaint
update: removed initial example as it could be confusing
|
|---|