sagat has asked for the wisdom of the Perl Monks concerning the following question:
This sub goes thru a list, checks the elements of the list in a database for its value, then returns $variable, which is a integer. Then I run $command, which expects some string followed by a carriage return. We SHOULD end up with something like this in the $command log file.sub checkdb { foreach $_ (@_) { .. ... # snipped code where we munge around the db and get our ... # $variable if ($variable < $threshold) { $command = '/usr/bin/blah'; $UPDATE = `$command << EOF $variable is the value from DB. $variable is less that $threshold EOF`; } else { } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A problem with variables inside a system() call
by davido (Cardinal) on May 13, 2004 at 22:03 UTC | |
by sgifford (Prior) on May 13, 2004 at 22:12 UTC | |
|
Re: A problem with variables inside a system() call
by jarich (Curate) on May 14, 2004 at 01:51 UTC | |
|
Re: A problem with variables inside a system() call
by sgifford (Prior) on May 13, 2004 at 22:08 UTC | |
by sagat (Novice) on May 13, 2004 at 22:23 UTC | |
by sgifford (Prior) on May 13, 2004 at 22:29 UTC | |
by sagat (Novice) on May 13, 2004 at 22:42 UTC | |
by sgifford (Prior) on May 13, 2004 at 22:45 UTC | |
|
Re: A problem with variables inside a system() call
by zude (Scribe) on May 13, 2004 at 23:27 UTC |