subroutine($variable, %hash, @array); ->subroutine($variable, \%hash,
\@array);
sub subroutine {
my($variable, $hash, $array) = @_;
so to reference use : $hash->{xxx} or $array->[0]. etc.
Wags ;)
-----Original Message-----
From: Dave Watkins [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 19:26
To: [EMAIL PROTECTED]
Subject: Passing variables to subroutines
Hi All
I am trying to pass a variable, a hash table and an array into a subroutine
like so
subroutine($variable, %hash, @array);
and pick it up like so
sub subroutine {
my($variable, %hash, @array) = @_;
but it seems the array isn't being passed, I can print the contents of the
array before the sub is called but if I try to print it from within the sub
I get nothing. The other 2 are being passed fine. If it makes any
difference the sub is in another file, but "require" is being used.
Thanks