in reply to Another eval $@ question

Other monks will likely have better ideas, but here are my thoughts.

I hope this gives you a start. The bottom line is that I don't think eval is what you want here, and it's hard to give you more specific advice until you tell us how you will tell the difference between success and failure for the command (output vs exit value).

Update: added a link to perlfaq8

Replies are listed 'Best First'.
Re^2: Another eval $@ question
by PugSA (Beadle) on Oct 13, 2006 at 05:43 UTC

    You are correct in saying -> (you appear to want to test the result of the command, not the result of the system call).

    I do currently spool the STDERR and STDOUT to a file but I'm not to sure how to put this in a variable for only selected cases

    Here is how I spool the STDERR & STDOUT to File. I'll also look at If you want to trap the output of the command, you should be using backticks or qx instead (see perlop).

    open (STDOUT, "> $system_folder\\system.log") or die "Can't redirect s +tdout: $!"; open (STDERR, ">&STDOUT") or die "Can't dup stdout: $!";

    Thank you