Loading ...
Sorry, an error occurred while loading the content.
 

Escaping Special Characters

Expand Messages
  • Joe Catanzaro
    I m attempting to use Perl to open and work with Oracle SQL Plus. My problem is that the SQL Plus password has a special character in it and needs to be
    Message 1 of 2 , Sep 2, 2003
      I'm attempting to use Perl to open and work with Oracle SQL Plus. My
      problem is that the SQL Plus password has a special character in it and
      needs to be escaped. The first example works great when I escape the @ with
      a \ How do I escape the special character when it's in a $var?

      Thanks,


      This works great
      my $cmd = "/opt/app/oracle/product/8.1.7/bin/sqlplus happyuser/secure\@box1
      << EOF

      This breaks at the password
      my $cmd = "/opt/app/oracle/product/8.1.7/bin/sqlplus happyuser/$password << EOF





      Joe Catanzaro
      joecatanzaro@...
    • Joe Catanzaro
      To answer my own question................. Recipe 1.13 in O reilly s Perl Cookbook helped me out with this one. Here s what I did. $password =~ s/(@)/ $1/g;
      Message 2 of 2 , Sep 2, 2003
        To answer my own question.................

        Recipe 1.13 in O'reilly's Perl Cookbook helped me out with this one. Here's
        what I did.

        $password =~ s/(@)/\\$1/g;

        And it works great.





        At 9/2/03 12:36 PM Tuesday, you wrote:
        >I'm attempting to use Perl to open and work with Oracle SQL Plus. My
        >problem is that the SQL Plus password has a special character in it and
        >needs to be escaped. The first example works great when I escape the @ with
        >a \ How do I escape the special character when it's in a $var?
        >
        >Thanks,
        >
        >
        >This works great
        >my $cmd = "/opt/app/oracle/product/8.1.7/bin/sqlplus happyuser/secure\@box1
        ><< EOF
        >
        >This breaks at the password
        >my $cmd = "/opt/app/oracle/product/8.1.7/bin/sqlplus happyuser/$password
        ><< EOF
        >
        >
        >
        >
        >
        >Joe Catanzaro
        >joecatanzaro@...
        >
        >
        >Yahoo! Groups Sponsor
        >ADVERTISEMENT
        ><http://rd.yahoo.com/M=244522.3707890.4968055.1261774/D=egroupweb/S=1705006951:HM/A=1595055/R=0/SIG=124j83ehr/*http://ashnin.com/clk/muryutaitakenattogyo?YH=3707890&yhad=1595055>2ac77bed.jpg
        >2ac77cf2.jpg
        >
        >Unsubscribing info is here:
        ><http://help.yahoo.com/help/us/groups/groups-32.html>http://help.yahoo.com/help/us/groups/groups-32.html
        >
        >
        >Your use of Yahoo! Groups is subject to the
        ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.


        Joe Catanzaro
        joecatanzaro@...

        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.