[Ma-linux] Perl 2D hash array

atrus at atrus.org atrus at atrus.org
Mon Jun 29 17:19:03 EDT 2009


On Mon, Jun 29, 2009 at 4:25 PM, Przemek Klosowski<przemek at jazz.ncnr.nist.gov> wrote:
> I have a perl question; 
...
> I tried the obvious but it didn't work:
>
> foreach $a (sort keys %database) {
>        print "$a,";
>        foreach $b (sort keys %$database{$a}){
>                print "$b,"
>        };
>        print "\n";
> }

Change
       foreach $b (sort keys %$database{$a}){
to
       foreach $b (sort keys %{$database{$a}}){

Cheers,
-Nikolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 270 bytes
Desc: OpenPGP digital signature
Url : http://calypso.tux.org/pipermail/ma-linux/attachments/20090629/c8970245/attachment-0001.bin 


More information about the Ma-linux mailing list