develooper Front page | perl.beginners | Postings from December 2002

Hash Access Query

Thread Next
Ben Crane
December 3, 2002 02:05
Hash Access Query
Message ID:

right, my first attempt at a hash of arrays appears to
have some success...but I have a query:

sub HoA
foreach $arb (@uniqueroadname)
foreach $doublearb (@contents)
if ($doublearb =~ m|$arb|)
print "$arb ====  $doublearb\n";
push @temparray, $doublearb;
 $arrayref{$arb} = [@temparray];

as far as I've tested, %arrayref contains ARRAY0x23233
-> etc...but I'm trying access that array:

$arrayref{$arb}[0] = will access the first array after
"following" a specific reference? Therefore, do I
access individual elements of that array through

at the moment, the structure looks (i hope :) like

%HASH - > Reference (roadname) -> Array 1
                               -> Array 2
                               -> Array 3

i reference the roadname which takes me to the next
tier, and then I can access all the arrays containing
info about that particular roadname (reference)...I
guess it's a one-many relationship...


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About