Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
&func( $scalar, @array ); sub func { my $var = shift; my @list = @_; # do stuff }
Will $var have the value of $scalar and @list the value of @array?
If not, I had considered passing in the parameters as a scalar and a reference to an array. That would go like this
&func ( $scalar, \@array ); sub func { my $var = shift; my @list = ???? #what the heck do I put here to get @list == @array? # do stuff
Am I correctly passing an array reference into func? And once I do so, how do I get it out again?
Thanks in advance.
JAreallybadPH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parameters
by chipmunk (Parson) on Jan 19, 2001 at 01:51 UTC | |
|
(jeffa) Re: parameters
by jeffa (Bishop) on Jan 19, 2001 at 01:53 UTC | |
|
Re: parameters
by $code or die (Deacon) on Jan 19, 2001 at 02:45 UTC | |
|
Re: parameters
by Anonymous Monk on Jan 19, 2001 at 20:37 UTC |