sub in_array {return scalar grep{/^@{[pop]}$/}@_}
Comment on
simple utility method
Replies are listed 'Best First'.
Re: simple utility method
by
ikegami
(Patriarch)
on Feb 15, 2008 at 18:15 UTC
Three bugs. It doesn't convert the strings to regexps (
\Q..\E
), it assumes
$
means end-of-string (
\z
), and it just plain doesn't work. Try
print in_array('a', 'b', 'c'); # 1 (b)
[download]
[reply]
[d/l]
[select]
Back to
Obfuscated Code