wruehl has asked for the wisdom of the Perl Monks concerning the following question:
$testmessage = system(/usr/bin/postemsg -S tecserver -r(harmless) -m "(This is a test message)" hostname=(Trapeze) notify_action=email alias_notify=(pbkhk) (Event_Message_Class) (SOURCE));
I am getting the following as output:
Bareword found where operator expected at TDC-fabric-monitor.pl line +172, near "/usr/bin" (Missing operator before bin?) Unquoted string "tecserver" may clash with future reserved word at TDC +-fabric-monitor.pl line 172. Unquoted string "harmless" may clash with future reserved word at TDC- +fabric-monitor.pl line 172. Bareword found where operator expected at TDC-fabric-monitor.pl line 1 +72, near "m "(This is a test message at the end of the script)" hostn +ame" (Do you need to predeclare m?) Bareword found where operator expected at TDC-fabric-monitor.pl line 1 +72, near ") notify_action" (Missing operator before notify_action?) syntax error at TDC-fabric-monitor.pl line 172, near "/usr/bin" Execution of TDC-fabric-monitor.pl aborted due to compilation errors
Is there any way to format the system call so that Perl just passes that call to the outside shell? Should I be using something other than system() to call the postemsg command?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Launching an external command from Perl in Linux
by kennethk (Abbot) on May 05, 2009 at 15:55 UTC | |
|
Re: Launching an external command from Perl in Linux
by JavaFan (Canon) on May 05, 2009 at 15:53 UTC |