Oct 13, 2017, 9:56 AM
Post #2 of 9
This should not happen with single quotes, which you seem to be using.
Re: [NAS] PERL interpreter misunderstand UNIX $
[In reply to]
Otherwise, one way to insert a literal $ in a string is to escape it, i.e. to prefix it with a backslash.
I would suggest that you construct your shell command as a string in a variable, and pass that variable to the qx// construct. This way, you can print that variable (before calling the shell) and make sure is contains what you need to pass to the system.
Finally, Perl is a fairly powerful language, you really rarely need to shell out. Do what you have to do with Perl if and when you can, don't shell out unless you really have to. The code you've shown is not complete, so I can't really figure out what it does, but it is quite possible that you can do it in pure Perl.