I just can't work this out, i've created a scalar which is an array reference and when I make an array = the array ref and then loop the array $_ = an array , yet it is a hash.
can anyone straighten me out on that is going on.
module has
scripts has...
and what gets printed is
All I want to do is create an object that has a variable which is an array of hashes, how difficult can this be, or how dumb must i be, because i cant work this out.
I've tried..
so I could then do
but that just prints an array reference as well.
I know 100% that @rs is an array of hashes, but i can't seem to turn it into an object with a variable that is an array of the hashes and then use it in my script.
hope this makes sense to someone!
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
can anyone straighten me out on that is going on.
module has
Code:
# Return Record Set Array of Hashes
$self->{'RS'} = \@rs;
scripts has...
Code:
my @recs = $sql->{'RS'};
for(@recs){
print $_ . "<br />";
}
and what gets printed is
ARRAY(0x171b4d0)
All I want to do is create an object that has a variable which is an array of hashes, how difficult can this be, or how dumb must i be, because i cant work this out.
I've tried..
Code:
@{ $self->{'RS'} } = @rs;
so I could then do
Code:
for($sql->{'RS'}){
print $_ . "<br />";
}
but that just prints an array reference as well.
I know 100% that @rs is an array of hashes, but i can't seem to turn it into an object with a variable that is an array of the hashes and then use it in my script.
hope this makes sense to someone!
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!