http://qs321.pair.com?node_id=1135033


in reply to How to handle metacharacters in input file for Perl one-liner code

Besides the good advice you've received above, you should also investigate regex anchors ^ and $, for example:
s/^$file$/something goes here/

Search for "anchor" in perlretut#Simple word matching.

-QM
--
Quantum Mechanics: The dreams stuff is made of