in reply to How to print Hash with multidimensional keys

Data::Dumper should do the trick:
use Data::Dumper; print Dumper(\%test);


§ George Sherston

Replies are listed 'Best First'.
Re: Re: How to print Hash with multidimensional keys
by learn_forever (Acolyte) on Jun 04, 2002 at 19:45 UTC
    Certainly this helped.

    But is there any way that this output can be formatted (say pipe separated for a particular key wise etc? So as it prints
    key1_val|key2_val|key3_val|element_val \n
    And so on?

    Of course now I will study more abourt Dumbper class

    Thanks
      As you've probably seen from the Data::Dumper docs, several output formats are offered, one of which may suit your needs.

      In any event, the Dumper output follows regular rules, so you can write regexes to convert it to whatever format was useful. Arguably it's quicker to let Data::Dumper turn it into a regular format and then regex, than try to iterate through and do the conversion yourself.

      When I have done this, I've always been glad when I remembered the /s regex modifier ;)

      § George Sherston