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

Re: [PBML] Truncated line of text

Expand Messages
  • Paul Archer
    ... First, the at sign is a sigil meaning an array , and the double quotes do allow for variable interpretation. So @run_cost_object looks like a variable
    Message 1 of 2 , Jun 20, 2007
    • 0 Attachment
      2:59pm, wjester wrote:

      > I have a perl program that creates a sqlplus command to load a table.
      > Assuming all the variables are defined properly, here is the code snippet
      >
      > $command = "/usr/bin/ksh -c \"sqlplus EFIND_OWNER/${OPSWD}
      > @run_cost_object.sql >> " . "$CostObjLog\"";
      > print "Upd Command = $command\n";
      > $rc = `$command`;
      >
      > When running the program, this is what I see from the print
      >
      > Upd Command = /usr/bin/ksh -c "sqlplus EFIND_OWNER/n5eagh+05 .sql >>
      > /usr/home/efindadm/efind//CstObjLog.20070620_10_56"
      >
      > Notice that the text starting with the " @ " is missing. I am sure
      > the problem is caused by the @ sign as a replacement character will
      > print out OK.
      >
      > Does this phrase have to be escaped and, if so, how is it done. I
      > have tried several things to no avail.
      >

      First, the 'at' sign is a sigil meaning an 'array', and the double quotes do
      allow for variable interpretation. So '@run_cost_object' looks like a
      variable to Perl.

      Second, if you had been 'use'ing 'strict' and 'warnings', you would have
      gotten an error message about the '@run_cost_object' variable.

      Third, to escape it, use a backslash: \@run_cost_object

      Fourth, since you're dealing with a database, you really should be using DBI
      (the 'database independent interface for Perl').


      Paul
    Your message has been successfully submitted and would be delivered to recipients shortly.