use IPC::Open3; use POSIX ":sys_wait_h"; package SysCall3; sub exec{ my $self = shift; my $command = shift; $self = {}; my $pid = open3 my $wh, my $rh, my $eh, $command; $self -> { EXITCODE } = $?; close $wh; $self -> { STDOUT } = <$rh>; close $rh; $self -> { STDERR } = <$eh>; close $eh; waitpid $pid,0; return bless $self; } sub getinfo( my $self = shift; return $self -> { shift() }; } 1;