in reply to Re^2: help with user selected hash operations?
in thread help with user selected hash operations?

... i keep getting HASH(x) in place of the names i'm putting in ...
... Phil HASH(0x6453d0) ...

That's because:

  1. You still have statements like
        $son_father{$name1} = {$add_dad};
    which add an (incomplete) hash reference instead of a name; and
  2. You still do not have a
        use warnings;
    statement at the start of your script to enable Perl to tell you (update: or at least give you a hint) about stuff like this.

I would add that you're also still using a weird indenting scheme that makes the inherent structure of your code very hard for me to follow; I hope it's easier for you, but I suspect not.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: help with user selected hash operations?
by lunette (Acolyte) on Oct 30, 2017 at 18:56 UTC

    oh, shoot. i added "warnings" and "diagnostics" after posting this comment, my apologies... i'm still learning what's easiest for me in formatting, but i think i understand what everyone is saying re: indentations.

    an incomplete hash reference... i think i get it. i'll make sure to ask my professor about this. hashes are still brand new to me, so i'm getting easily frustrated when i really shouldn't be. thank you!

      an incomplete hash reference...

      The critical point is not that the  {$add_dad} "name" you are assigning in the
          $son_father{$name1} = {$add_dad};
      statement is an incomplete hash reference, it's that it is a hash reference at all. Please ask your professor about "anonymous hash and array constructors (or composers)". Please see Making References (item 3 in particular) in perlref.


      Give a man a fish:  <%-{-{-{-<