Help for this page

Select Code to Download


  1. or download this
    my $coderef = \&some_sub;  # $coderef contains a reference to &some_su
    +b
    my $results = $coderef->();
    
  2. or download this
    my $subname = 'some_sub';
    my $results = eval "$subname()";
    die $@ if $@;
    
  3. or download this
    my $results = do { no strict 'refs'; $subname->() };
    
  4. or download this
    use strict;
    use warnings;
    ...
    42
    Hello world!
    42