in reply to How to trick this program (weird catch-the-output problem)?

Please check if $output is really empty or undef (i.e. use defined). If it's really empty then you program really doesn't print anything.

Otherwise: The back ticks return undef in scalar context when the called program fails, i.e. returns a non-null value. This is normally the case when wrong arguments are provided to the program. So your program probably prints the warning but it is not returned by the back ticks because the program call failed.

You could try to use open in order to read the output:

open (my $call, '-|', "$command 2>&1"); $output = join //, <$call>; # or use { local $/; $output = <$call>; } close ($call);
Please see the perldoc -f open for the exact behavior of open in the case of failure.

Update: It looks like the the back ticks return only undef when the given program couldn't be started, i.e. wrong name or permissions, but not when it fails. But checking if the output is really defined is still a good idea. Are you running the perl program under an other user, e.g. over CGI?