Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: "array" search

by lidden (Curate)
on Jan 13, 2006 at 06:47 UTC ( [id://522912] : note . print w/replies, xml ) Need Help??


in reply to "array" search

I think you are trying to to this:
if($self->{keys}->[$key]){ # do something with the knowledge that we got the correct key # then exit out of function using this loop } # do something with the knowledge there is no key with that name

Replies are listed 'Best First'.
Re^2: "array" search
by Sheol (Novice) on Jan 14, 2006 at 08:47 UTC

    Not quite... $key contains a name, not an index. doing $self->{keys}->[ $key ] won't work.

    I could do $self->{keys}->{$key} but I don't think that would work in the case where I might serialise the object.