Help for this page

Select Code to Download


  1. or download this
    sub func {
       # Any changes to $_ will affect the caller's var.
       local *_ = \$_[0];
       ...
    }
    
  2. or download this
    sub func {
       my ($s) = $_[0];  # Safe.
       local *_ = \$s;
       ...
    }
    
  3. or download this
    sub func {
       # Any changes to $_ will affect the caller's var.
    ...
          ...
       }
    }
    
  4. or download this
    sub func {
       for (my $s = $_[0]) {  # Safe.
          ...
       }
    }