How do I reference print in Perl?
1 answer
It will \&CORE::print
, but lists as unavailable . perldoc CORE
print
You can just wrap the anon environment around it and redirect the arguments:
my $p = sub { print @_ };
$p->("hi");
Also, the original non-backslash method works in Perl 6 :
my $p = &print; $p("hi")
+5
source to share