http://www.perlmonks.org?node_id=497666


in reply to Re^2: pattern match a name from stdin
in thread pattern match a name from stdin

The \Q is making the '$' match a literal '$'. You want  m/\Q|$file\E$/, methinks.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart