Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Escaping and quoting ?????

by NetWallah (Canon)
on Jul 03, 2014 at 12:59 UTC ( [id://1092163]=note: print w/replies, xml ) Need Help??


in reply to Escaping and quoting ?????

Your statement
@Output = qx { /nz/kit/bin/nzsql -d histdb -c "$SQL1" };
causes the shell to re-interpolate the contents of $SQL, because you use double quotes.

You could either pass single quotes to the shell, or add another "\\" before each dollar sign in the contents of $SQL. I'd suggest:

@Output = qx { /nz/kit/bin/nzsql -d histdb -c '$SQL1' };

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Replies are listed 'Best First'.
Re^2: Escaping and quoting ?????
by pgduke65 (Acolyte) on Jul 03, 2014 at 16:29 UTC

    Thanks for the clarification on the problem. I had forgotten to change the quotes from doubles to singles for the -c argument. It worked like a charm. Thank you all for the help. Perl Monks are awesome!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found