in reply to Re: looking for simple way to check scalar against array
in thread looking for simple way to check scalar against array

Gawd, believe me: I'm very keen on regexen myself, but I wouldn't use one where what you really want is an equality operator! And in that case it should be
/^$i$/ if you qw/really wanted to do it like that/;

Update: As duly pointed out by ikegami, to be really more precise, one should use /^\Q$i\E$/, which may seem nitpicking wrt this particular example, but which can be also absolutely necessary in other situations... (well, not that you would use this actual regex, but maybe a somewhat similar one.)