--- "Morse, Loretta" <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> While running a perl script on NT is there a way to capture the
> return status of a command? I know how to do this on unix but it
seems
> to be different on NT. I know there is a variable called errorlevel
on
> NT but not sure how to access this from a perl script.
>
> Here is what I'm trying to do...
> $status = `cleartool co -nc foo.c`;
my $status = system "cleartool co -nc foo.c";
Though I think it's considered more secure to pass the command as a
list.
(perldoc -f system)
> $status ends up with the stderr output, not the status of how
> successful the command was.
That's what backticks do.
You might also check $?, which is supposed to hold the error code, and
$!, which hold the string for that code if there is one.
(perldoc perlvar)
> Anybody familiar with this on NT?
> Thanks.
Honestly, no, but Perl is pretty platform independent.
It should be pretty much the same, though I can't promise.
Paul
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/