Running perl 5.10.1, Sudo-0.32 installed from CPAN, running on Debian
Squeeze.
Linux cgid4.internal.tuskerdirect.com 2.6.32-5-amd64 #1 SMP Sun May 6
04:00:17 UTC 2012 x86_64 GNU/Linux
I'm getting very weird output from Sudo on our new development
environment. On running a simple script I get a result hash of (using
Data::Dumper):
$VAR1 = {
'HASH(0x2255748)' => undef
};
Use of uninitialized value in printf at
/home/Tusker_Dev_1/web/cgi-bin/backoffice/test_ipc.cgi line 31.
Use of uninitialized value in printf at
/home/Tusker_Dev_1/web/cgi-bin/backoffice/test_ipc.cgi line 32.
Use of uninitialized value in printf at
/home/Tusker_Dev_1/web/cgi-bin/backoffice/test_ipc.cgi line 33.
<br />STDOUT: <br />STDERR: <br />return: <br />
The key there is actually the string 'HASH(0x2255748)', and not a hash :)
#! /usr/bin/perl
use warnings;
use strict;
# use IPC::Run;
use Sudo;
use Data::Dumper;
my $sudo = Sudo->new( {
sudo=>'/usr/bin/sudo',
username=> 'dataload',
program=>'/home/dataload/scripts/bin/dataload_env.sh',
program_args=>'/home/Tusker_Dev_1/web/cgi-bin/backoffice/dataload/get_global_summary.pl',
# debug=>3,
});
my $result = $sudo->sudo_run();
print "Content-Type: text/html\n\n";
print Dumper($result);
print '<br />';
if (exists($result->{error}))
{
&handle_error($result);
}
else
{
printf "STDOUT: %s<br />",$result->{stdout};
printf "STDERR: %s<br />",$result->{stderr};
printf "return: %s<br />",$result->{rc};
}