You're quite right Ed, it's safer to copy the parameters at the start of a
subroutine. Behind the scenes the parameter values are passed by reference,
so modifying @_ directly will change the value used as the actual parameter
in the calling code. Copying 'my @params = @_' will give you a local copy of
the values which you can change if you want without affecting anything
outside the scope of the subroutine. Apart from this, though, accessing the
parameter list like this will work fine: I doubt if it's the cause of the
problem.

Rob


"Ed Christian" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Correct me if I'm wrong group (I'm still a Perl novice myself), but
> whenever one passes an argument to a subroutine, shouldn't one always
> set local variables to $_[x]? Or at the very least add my @params = @_?
>
> Paul: My suggestion is to add "my $param = $_[0];" as the first line of
> sub buildexcel, and replace instances of $_[0] with $param.
>
>
> - Ed
>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to