in reply to left side of pattern matching

I think that your confusion comes from escaping the pipe, but since it is within a character-class [...] you don't need to escape it so it's the same both ways.

DB<100> $hello = "\n |\t\r"; => "\n |\t\r" DB<101> $hello =~ m/^[ \|\t\r\n]+$/ # matches => 1 DB<102> $hello =~ m/^[ |\t\r\n]+$/ # matches too => 1

Cheers Rolf