in reply to Regular expressions and Arrays

In Perl, the slashes are not part of the regular expression. So drop them and you're getting close to something you could use.
@compare = ('^foo ', ' bar$'); $i=0; foreach (@compare){ unless $test =~ $compare[$i]){ print $test; $i++ } }
But even though this will work, I agree with kvale: if at all possible, you'd be better of using qr//.