Help for this page

Select Code to Download


  1. or download this
    sub recurse {
      my $level = shift;
      print "recurse [$level]\n";
      recurse($level - 1) if $level > 0;
    }
    
  2. or download this
    #!/usr/bin/perl -w
    
    ...
    *oldsub = \&newsub;
    
    $oldsub_ref->(2);
    
  3. or download this
    oldsub [2]
    oldsub [1]
    ...
    Subroutine main::oldsub redefined at ./typeglob_clobber.pl line 22.
    oldsub [2]
    newsub [1]
    
  4. or download this
    my $coderef = do {
      my $selfref;
    ...
        # use $selfref here for recursion
      };
    };
    
  5. or download this
    {
      my $selfref;
    ...
      }
      $selfref = \&named;
    }