Here's some code that you may find useful. You need to take into account one of the previous comments that this is only a snapshot, but it should help you.
#!/usr/bin/perl use strict; sub sub1 { print "In sub1\n"; } sub sub2 { print "In sub2\n"; } sub sub3 { print "In sub3\n"; } sub MergeHashes { my ($hr1, $hr2) = @_; my (%retval, $nkey, $key); print "hr1 = $hr1, hr2 = $hr2\n"; foreach $key (keys %{$hr2}){ $retval{$key} = $$hr2{$key}; } foreach $key (keys %$hr1){ if (!defined($retval{$key})){ $retval{$key} = $$hr1{$key}; } } \%retval; } sub showhash { my ($hr, $hn) = @_; my %hash = %$hr; my @subs; no strict; return if ($checked{$hr}); $checked{$hr} = 1; my $symname; foreach $symname (sort keys %hash){ local *sym = $hash{$symname}; if (@sym){ push(@subs, "array $symname"); } elsif (%sym){ push(@subs, "hash $symname"); showhash(\%sym, $symname); } elsif (defined(&sym)){ push(@subs, "sub $symname"); } else { push(@subs, "var $symname"); } } if (scalar @subs){ print "Package $hn => "; foreach $symname (sort @subs){ print "\t", $symname, "\n"; } } } my %hash = ( h1 => { a => "A", c => "C", e => "E", g => undef, i => undef, }, h2 => { a => "A2", b => "B", d => "D", g => "G2", h => undef, } ); showhash(\%main::, "%main::");
Enjoy.

In reply to Re: a list of functions within a pm by bschmer
in thread a list of functions within a pm by shrubbery

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.