![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl hashes "Can't use subscript on private hash" | Smiling Dragon | Shell Programming and Scripting | 9 | 07-27-2008 07:42 PM |
| Awk Hash Function. | dinjo_jo | Shell Programming and Scripting | 2 | 07-16-2008 06:30 PM |
| Hash within array, within hash, within array... | jsmoriss | Shell Programming and Scripting | 1 | 07-10-2006 09:26 PM |
| getting data list into a hash array | topcat8 | Shell Programming and Scripting | 5 | 03-09-2004 12:02 PM |
| Hash (#) as a variable | errolg | UNIX for Dummies Questions & Answers | 5 | 05-21-2002 03:03 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Print Entire hash list (hash of hashes)
I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes).
Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in some of them I'm getting : HASH(0x98f3dc8) Any suggestions how can I implement this ? |
|
||||
|
I guess you are talking of a Perl script here.
What you see is when you try to print a Perl hasref. To see its contents you need to derefernce it like e.g. Code:
print map "$_\n", keys %{$some_hashref};
would be to load your script into the Perl debugger (just issue "$ perl -d /path/to/yourscript.pl") Then continue to a line (type c line#) where your data structure has been built up or autovivified. Then type "|x $hashref" or "|x \%hash" and page through your LoL. You also could use the Code:
Data::Dumper See its POD for details. Oh no, I hate those silly auto-inserted smileys as in Dumper above) Last edited by jim mcnamara; 08-06-2008 at 09:53 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|