I have a script which needs to execute unix commands using the backtick operator.
I am using the eval function to evaluate and run the unix command, and then I'm doing a Boolean test on $@ to determine if there has been an error.
thus
eval `$statement`;
if($@)
{print "error"; )
else
{print "statement successful"; }
This works when a real error is found, but if I get a simple warning, processing continues down the else leg, as if the statement worked ok.
How can I force warnings to be treated as errors, or set $@ to TRUE (or the error value) so I get the error msg for a warning ?