in reply to Testing if a HoH key exists

You can just delete the key without testing, unless you plan to do something else in that 'if' block.

Replies are listed 'Best First'.
Re^2: Testing if a HoH key exists
by Jeri (Scribe) on Nov 11, 2011 at 17:20 UTC
    What if the key doesn't exist? Will it throw an error? (I would test it but my data is convoluted)

      It will not throw an error. Try simply,

      perl -e 'use strict; use warnings; my %H; delete $H{jeri}'
        Thanks, it's working. Sorry if these concepts seem trivial to some people (just judging by my votes). I haven't been programming very long and this is the first time I've worked with HoH. I apologize if I'm being a burden to the forum.