in reply to Code cleanup; how best to deal with: defined(%hash) is deprecated at...

Here is an more declarative alternative to do the tests and assignment you show above:
%tags = ( %tags, %{ {l=>\%leftright, r=>\%leftright, t=>\%topbottom, b=>\% +topbottom }->{$position} } );
It will give the right results (with warnings) if any of the expected values is not defined, or incorrect.

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

  • Comment on Re: Code cleanup; how best to deal with: defined(%hash) is deprecated at...
  • Download Code

Replies are listed 'Best First'.
Re^2: Code cleanup; how best to deal with: defined(%hash) is deprecated at...
by taint (Chaplain) on May 23, 2014 at 07:23 UTC
    Hello, NetWallah.

    Thank you very much for taking the time to do that for me. I like it. You're right, and it's alot smaller too. :). I'm afraid I sometimes get so focused, and obsessed on what I'm doing. It's kind of a "Forrest for the Trees" sort of thing. I really need to condition myself to step back, or away from it, more often. :)

    I really appreciate your taking the time to whip that up, for me, NetWallah.

    All the best.

    --Chris

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH