Yes, perl interpolates double quoted strings, including regular expression patterns used in the match and substitution operators. The gory details are in: Gory details of parsing quoted constructs.
If you don't want string interpolation you can use single quoted operators:
if ( $hello =~ m'^[ \|\t\r\n]+$' ) {
But then "\t", "\r" and "\n" won't be interpolated.
In reply to Re: left side of pattern matching
by jwkrahn
in thread left side of pattern matching
by BeneSphinx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |