Help for this page

Select Code to Download


  1. or download this
    sub prototyped($_;$)
    {
      # Here $_[0] is a compulsory argument
    ...
      # $_[1] defaults to $_
      # $_[2] may not even exist
    }
    
  2. or download this
    sub unprototyped
    {
      goto &unprototyped @_, $_ unless @_ > 1;
      # See comments in previous exemples
    }
    
  3. or download this
    sub unprototyped
    {
      push @_, $_ if @_ < 2;
    ...
      $_ = $_[-1];
      # Return value here
    }
    
  4. or download this
    use v5.14;
    
    sub f2
    ...
    __DATA__
    Everyone
    Perlmonks