Next | Automated Testing | 6 |
Here's how I would have written it
sub sys_command { my @command = @_; system @command; { local $" = ')('; # print "ran command (@_) with exit status $?\n"; } return $? == 0; }
Then I can replace this:
$syscommand = "$RMFILTER display_filter $websec_token $account $ssn $pennname"; $returncode = &Syscommand(1); unless ($returncode == 0) { &reportError ("Can't display current filtered virus folder.", 0, 0, 0, 101); exit; }
with this:
unless (sys_command($SUDO, $RMFILTER, "display_filter", $websec_token, $account, $ssn, $pennname)) { reportError("Can't display current filtered virus folder.", 0, 0, 0, 101); exit; }
Next | Copyright © 2004 Mark Dominus |