Help for this page

Select Code to Download


  1. or download this
    my $oldsub_ref = \&oldsub;
    
    ...
    *oldsub = \&newsub;
    
    $oldsub_ref->(2);
    
  2. or download this
    my $sref = \&oldsub;
    sub oldsub {
    ...
      print "oldsub [$level]";
      $sref->($level - 1) if $level > 0;
    }