You are making up Perl syntax and expect it to work. I don't think that array slices and the =~ operator are documented to do anything sensible.
Again, you are not using strict. You should really get into the habit of doing that.
If you are using Perl 5.10 or newer, you might be able to put the "smart match" operator (~~) to work. See perlop on it. Otherwise, you could use grep to search through the array.
In reply to Re^3: Regex and array
by Corion
in thread Regex and array
by Deus Ex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |