in reply to Using references to subroutines
Here you can see that testsub becomes a reference to an anonymous subroutine. I then call it by dereferencing it and passing it a parameter to print. I could have used shift instead but wanted it to be a bit clearer for this example.use strict; my $testsub = sub { print $_[0]; }; &{$testsub}("hi");
|
|---|