November 15th, 2012, 09:16 AM
-
How can I print this output?
Example:
%hh =
(
key1 =>
{
** key2 => 'abc',
** key3 => {* keymany = 'value', },
*}
key11 =>
{
***key22 => 'def',
*}
)
*
Output:
key1** key2** abc
key1** key3** keymany*** value
key11* key22* def
November 15th, 2012, 10:20 AM
-
Originally Posted by jaden5165
Example:
%hh =
(
key1 =>
{
** key2 => 'abc',
** key3 => {* keymany = 'value', },
*}
key11 =>
{
***key22 => 'def',
*}
)
*
Output:
key1** key2** abc
key1** key3** keymany*** value
key11* key22* def
I would check out the Data::Dumper module.
November 15th, 2012, 11:22 AM
-
to print out the format you require you'd need to walk the hash of hashes
http://stackoverflow.com/questions/2363142/how-to-iterate-through-hash-of-hashes-in-perl
also check out Data::Visitor module on CPAN
--Ax
without exception, there is no rule ...
Handmade Irish Jewellery
Targeted Advertising Cookie Optout (TACO) extension for Firefox
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


09 F9 11 02
9D 74 E3 5B
D8 41 56 C5
63 56 88 C0
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. -- Jamie Zawinski
Deta
vil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ...
BIT COINS ANYONE
November 15th, 2012, 12:49 PM
-
Your hash declaration will not compile, I am afraid. You should fix it before you try to print it.
Otherwise, as a starting point, use Data:
umper and see if the output fits your needs.