Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by QM (Parson)
on Jul 16, 2015 at 15:29 UTC ( [id://1135033]=note: print w/replies, xml ) Need Help??


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

Replies are listed 'Best First'.
Re^2: How to handle metacharacters in input file for Perl one-liner code
by debug (Initiate) on Jul 17, 2015 at 06:42 UTC

    Thank you everyone for your excellent suggestions above.

    I will go ahead and replace my shell calls with direct Perl code. Also, QM's anchor suggestion is great, and would probably have helped me in the first place, though I'm kinda glad I did not, since it forced me to figure out the other loophole in my code. I'll go put it in my code now.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1135033]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-26 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found