in reply to Re: A problem with variables inside a system() call
in thread A problem with variables inside a system() call

Hi:

Ok, Im beginning to think this might be a problem with the command itself. I just added a print " "; around the $UPDATE section to the EOF piece, and the output looks exactly as it should.

The program should be singlethreaded, although the perl itself was compiled as multithreaded.

BTW, the $command was actually a propriatary sql interface to some strange DB.

BTW, I was looking at the thread of answers behind my question and Davido was refering to a "HERE doc." I've never heard of that before....
-chris

  • Comment on Re: Re: A problem with variables inside a system() call

Replies are listed 'Best First'.
Re: Re: Re: A problem with variables inside a system() call
by sgifford (Prior) on May 13, 2004 at 22:29 UTC
    << introduces a here document. The syntax and name come from the shell; < filename means get the input from a filename, and << means get the input from right here.

    You can find more in the perldata(1) manpage, or the manual for your shell.

      Thanks for the info.

      In any case, I got the $command << EOF from some other perl code provided by the DB maker, and I never felt quite comfortable with it. I guess it works, but I think I'll redo it using system().

      Once again, thanks for the help!

      -chris

        Re-implementing with open(CMD,"| $command"); might be closer to what you want.