SPUG: Reference to a hash

Matt Tucker tuck at whistlingfish.net
Fri Mar 22 12:37:31 CST 2002

-- "Martin, Asa" <asa.martin at attws.com> spake thusly:

> As I went through the loop I had to set "flags" to know where I was in
> processing. The %hash was for the Parents field. It wasn't finished
> until I hit '};'. Then I would assign it to
> %HoH{$recordnum}{Parents}. And since all the keys of %hash were
> __item__ I also had to create a small subroutine that made the key
> unique. What joys.

Since there's no associated key, why not just use an array? It seems
like you're representing a list for the Parents field; it would make
sense to use one:

    %HoH{$recordnum}{Parents} = [ @parents ];

> In addition, some of the fields, like sysDecr
> above split over multiple lines. It was kind of challenging. But I've
> got it figured out now. 
> Thanks again for everyone's input.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20020322/04b6dbce/attachment.bin

More information about the spug-list mailing list