in reply to Re: regular expression.
in thread regular expression.

I'm unclear why line 9 passes a syntax check...

Unary  ~ is bitwise negation. See Symbolic Unary Operators in perlop. It compiles, but is probably not logically correct. E.g.:

>perl -wMstrict -le "$_ = 'x'; print scalar(~ /x/); print scalar(~ /Y/); print 'match' if ~ /x/; print 'match' if ~ /Y/; " 4294967294 4294967295 match match

Update: Improved example code.