名前付きサブルーチンのリファレンス。Cでいう関数ポインタ。
use strict;
my $who = shift(@ARGV);
my $ref_yeah = \&yeah;
my $ref_hello = \&hello;
$ref_yeah->($who);
$ref_hello->($who);
sub yeah{
my ($who) = @_;
print "yeah! $who\n";
}
sub hello{
my ($who) = @_;
print "hello! $who\n";
}