in reply to (jeffa) Re: How to assign a hash from an array?
in thread How to assign a hash from an array?

use Data::Dumper;

print \@array;
print \%hash;
print $reference;

Won't work.

You'll need to type
use Data::Dumper; print Dumper(\%hash);

Furthermore recent postings have indicated that use of the special variables for sort, $a and $b, gets in the way of DWIM and should best be avoided for general use.

---
I would like to change the world but God won't let me have the source code.

Replies are listed 'Best First'.
(jeffa) 3Re: How to assign a hash from an array?
by jeffa (Bishop) on Mar 11, 2002 at 15:08 UTC
    Thanks for bringing the Dumper error to my attention.

    Now, as for $a and $b - i did already give a warning about them. However, i feel that in this case - it's ok to use them. I never declared them, see the difference? Those recent postings you refer to declare $a and $b as lexical variables.

    If you disagree, then please show me how my example would 'get in the way of DWIM'.

    Thanks again. :)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)