Leon wrote:
> Hi again,
> 
> I have a questions regarding stdout.
> 
> Basically I have a script that looks like this:
> 
> system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!";
> system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!";
> system("reg DELETE HKCR\\AppID\\OvEpSeMServer.EXE /f") && die "no $!";
> system("reg DELETE HKCR\\AppID\\OvMsmAccessManager.EXE /f") && die
> "no $!"; system("reg DELETE HKCR\\AppID\\OvPmdPolicyEditorFrame.EXE
> /f") && die "no $!";\ 
> 
> The script removes those keys from the registry if they are there
> however if the keys are not there I get this error: 
> 
> C:\scriptz>perl -w clean.pl
> 
> Error:  The system was unable to find the specified registry key or
> value no  at clean.pl line 7.
> 
> What i want to know is how I could go about writing the logic to grab
> what is being sent to the screen to test it and if it says error to
> just have the script keep going ignoring the error.  
> 
> Thx,
> 
> Leon
> 
  use `` and setup like :

        my $MyOutput = `reg DELETE HKCR\\AppID\\OvMsmAccessManager.EXE /f`;
        Now you can parse the $MyOutput to see if there was an error or not.  I mean 
you are controlling the output already by using die. If you want you could exchange 
the die with warn and it should function like you want with warnings.

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to