print "hi" if $n{11};
What if it's value is 0, '', or undef? It would exist but your test would miss it :)
In that case "defined" would be a beter function to use.
ok, but I'm still not interested in the value of the key I;'m interested inthe key, so why not exists since its made for hashes :)
I simply asked "what if" to illustrate why if $n{11} is not "better" than exists $n{11} in this case.
So the original question remains:
Which is faster:
1) slice the array into a has and do exists $hsh{key}
or
2) just grep a regex on the array
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>