Z
Zachary Buckholz
I am passing a reference to a hash where the key is a scalar and each
value is a reference to an array to another sub. But unless I use a
subscript like $_[0] I can not get it in the recieving sub. Typically
I can just use $_ when passing one variable;
I am using -w and use strict;
Example of what I am doing:
sub build_hash {
# code to build hash with scalar keys and ref to arrays as values
# each key has three array ref values.
parse_hash($some_ref_to_a_hash);
}
sub parse_hash {
my $some_ref_to_a_hash = $_; # <--- This does not work
}
sub parse_hash {
my $some_ref_to_a_hash = $_[0]; # <--- This WORKS!
}
I scanned deja.com for two days and the FAQ's on my local machine
before posting this.
value is a reference to an array to another sub. But unless I use a
subscript like $_[0] I can not get it in the recieving sub. Typically
I can just use $_ when passing one variable;
I am using -w and use strict;
Example of what I am doing:
sub build_hash {
# code to build hash with scalar keys and ref to arrays as values
# each key has three array ref values.
parse_hash($some_ref_to_a_hash);
}
sub parse_hash {
my $some_ref_to_a_hash = $_; # <--- This does not work
}
sub parse_hash {
my $some_ref_to_a_hash = $_[0]; # <--- This WORKS!
}
I scanned deja.com for two days and the FAQ's on my local machine
before posting this.