<br><div class="gmail_quote">On Thu, Mar 12, 2009 at 10:30 AM, Adam Prime <span dir="ltr"><<a href="mailto:adam.prime@utoronto.ca">adam.prime@utoronto.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Fulko Hew wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alex asked:<br>
<br>
> Couldn't you just use the ~! on the regex instead of ~=?<br>
</blockquote></blockquote><div><br>... snip ...<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
</blockquote>
<br>
it's !~, not ~!<br>
<br>
ie:<br>
<br>
aprime@primepc:~$ cat haha.pl<br>
<br>
my $text = 'haha';<br>
<br>
if ($text !~ /hat/) {<br>
print qq[yay\n];<br>
}<br>
else {<br>
print qq[yay\n];<br>
}<br>
aprime@primepc:~$ perl haha.pl<br>
yay<br>
<br>
also, given your example there, why wouldn't you just<br>
<br>
return true unless $_ eq 'good';<br></blockquote></div><br><br>Because I'm not allowed to rewrite the code, but simply insert a<br>different regex pattern in between the slashes.<br>