Help for this page

Select Code to Download


  1. or download this
    my $subname = "package::sub";
    if (my $coderef = main->can($subname)) {
      $coderef->(@args);
    }
    
  2. or download this
    use strict;
    my $coderef = \&$subname;
    $coderef->(@args);
    
  3. or download this
    perldoc strict:
    There is one exception to this rule:
    
                     $bar = \&{'foo'};
                     &$bar;