in reply to Returning a hash?

Very nearly there. Remember you have a hash ref, not a hash, so you need to dereference it:

my @aTable = keys %$hTableData;

Welcome to the mad house BTW. Nice first post.

Update you may find perldsc helpful too.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Returning a hash?
by jdtoronto (Prior) on Aug 24, 2006 at 05:47 UTC
    Naturally GrandFather is quite correct, BUT, I looked at his response and it took a moment to see that he was de-referencing the hash reference that is being returned.

    For precisely this reason, it is suggested in the book "Perl Best Practices" by thedamian (see p228-229) that when you need to use "prefix dereferencing" such as this, that you used braces around the reference:

    %{$hTableData}
    is more noticeable, and thus readable than:
    %$hTableData
    It makes the dereferencing easier to see in this case, and getting into this habit can make your dereferencing far easier to understand as you meet more complexes cases.

    I must also agree that perldsc is a most useful piece of reading. Welcome to the monastery!

    jdtoronto

Re^2: Returning a hash?
by ken2 (Novice) on Aug 24, 2006 at 02:45 UTC
    Thank you! I'm off and running with the next challenge. Glad to have found this site.