Tanalis has asked for the wisdom of the Perl Monks concerning the following question:
I'm currently writing a GUI to allow some of our non-technical guys to run some scripts and apps without having to delve into the depths of a console.
I need to trap the output from the scripts/apps so that we can report it to the user afterwards for error detection. I was using `` to do this:
but this doesn't work for some of the scripts (those that call external applications): they simply die saying they can't find the external command.# $cmd is defined earlier my $result = `$cmd 2>&1`;
If I substitute the backticks for system, all works as expected.
I've tried playing with chdir to ensure the working directory is that of the script/app, but this doesn't make any difference at all: the command still dies.
Can anyone see what I'm doing wrong, and why the backticks cause a different system call than using system? I'm running Perl 5.004.04 on Sun Solaris.
Thanks in advance for your help.
-- Foxcub
#include www.liquidfusion.org.uk
|
|---|