in reply to Re^2: Regex and array
in thread Regex and array

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.

Replies are listed 'Best First'.
Re^4: Regex and array
by Deus Ex (Scribe) on May 25, 2010 at 12:56 UTC

    Thanks corion.

    As I already wrote before, these that I posted were just examples to shorten the code to post on here. In real life, I really do use "strict" and "die".

    Unfortunately I work with a perl 5.8 interpreter, so I can't use the smart match operator (the functionality of which was the basis for my argumentation).

    I'll try the "grep" suggestion :)

    Thanks