Aaron Priven wrote:
> You should show us some code.
> 
> Normally you would do this in the subroutine:
> 
> sub routine {
> 
>    my $mydir = shift;
>    # which puts the value of $_[0] into $mydir
>    # and then removes that from the argument list
>    chop $mydir;
>    # do stuff with $mydir
> 
> }
> 
> That makes a copy of the value. It sounds like you are doing this:
> 
> sub routine {
>    chop $_[0];
>    # do stuff with $_[0]
> }
> 
> which is harder to understand, since $_[0] has no meaning for anyone, 
> and has the disadvantage of changing your original value.
> 

Not necessarily true. The subroutine in question may be in a module the
OP can't touch. Or it may be called so many times that it is easier to
change the code in only one place, rather than change the subroutine and
all the other calls to it.



-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to