C
C
chelius_ua2016-02-23 18:05:35
Perl
chelius_ua, 2016-02-23 18:05:35

How to escape in Perl?

Hello. I fight with a seemingly banal question, but I can not win.
There is an ORACLE SQL database: xyz
There is a user: aa_bb_ccc
Password: fd$efghjk_
There is a desire to push some packages called by a similar line through perl

sqlplus aa_bb_ccc/[email protected] @package.sql 201506

I try to start in the linux terminal to execute the following. command:
sqlplus aa_bb_ccc/fd\$efghjk_\@xyz
A connection to the required database under the required schema occurs. Then I want to connect from the perl script with a line . I get an error that the credentials are not correct (as far as I understand, because of the $ in the password) Everything works in single quotes, but they don’t fit, because from the example above 201506 will be taken from the variable. Please tell me how to implement it correctly and not cumbersome. I shoveled everything on escaping special characters, but all the variations I tried were unsuccessful ...
$rc=system ("sqlplus aa_bb_ccc/fd\$efghjk_\@xyz");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2016-02-23
@chelius_ua

Try
In theory, then there will be no interpolation of variables, and no shell call to run.
See the camel book, p. 875 (3rd ed., 2002). Well, perldoc.perl.org/functions/system.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question