programming-examples/perl/Subroutine/Pass reference to a subroutine to another subroutine.pl

11 lines
104 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
sub printhello
{
print "Hello!\n";
}
sub printem
{
&{@_[0]};
}
printem \&printhello;