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

You definately have a problem with your HERE doc syntax. Your quoting is screwed up, there's no terminating semicolon on the first line of the HERE, and you shouldn't have a close-quote after the ending token. Furthermore, the closing token should be alone on its line (the semicolon screws it up). I'd be surprised if this code compiles. Are these just typos in typing your question? Also, it's not clear to me exactly, but it looks like you're trying to create the following system command:

/usr/bin/blah $variable is the value from DB. $variable is less than $threshold

So you've got embeded newlines in your invocation of the command, and unquoted barewords. What exactly do you want your command to look like when it gets passed to the operating system?


Dave

Replies are listed 'Best First'.
Re: Re: A problem with variables inside a system() call
by sgifford (Prior) on May 13, 2004 at 22:12 UTC
    The here document is parsed by the shell, not Perl. It's interesting; I haven't seen this before, and I'm surprised that it works this way. For example, if I put my code from 353223 into /tmp/t13 and run strace -e execve -f perl /tmp/t13 I get:
    ... [pid 5261] execve("/bin/sh", ["sh", "-c", "/bin/cat << EOF\n24 is the + value "...], [/* 37 vars */]) = 0 ...