Bill Gradwohl wrote:
my $arrayPointer;
# This works:
@{$arrayPointer}=qw(Money preserver sunscreen);
check_required_items("Mr. Howell", $arrayPointer);
# These don't work:
check_required_items("Mr. Howell", @{$arrayPointer}=qw(Money preserver
sunscreen));
check_required_items("Mr. Howell", qw(Money preserver sunscreen));
How do I tell Perl to give me a reference to an array in the last 2
statements? There's got to be a way to pass a reference without having
to explicitly name a variable. Right?
Try:
check_required_items("Mr. Howell", $arrayPointer=[qw(Money preserver
sunscreen)] );
check_required_items("Mr. Howell", [qw(Money preserver sunscreen)] );
--
Just my 0.00000002 million dollars worth,
--- Shawn
"Probability is now one. Any problems that are left are your own."
SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_
* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is available 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>