Bowie Bailey wrote:

> [EMAIL PROTECTED] wrote:
> 
>>># doesn't work
>>>if(-e
>>>"%systemdrive%\\servicedisk\\tools\\seachange\\SeaPatch.exe"){
>>>print "yes\n"; }else{ print "no\n"; } 
> 
> Here, "%systemdrive" is being treated as a Perl hash and probably
> expands to a null string.

Hashes aren't interpolated in strings - it's treated literally.

>>># work on either versions
>>>
>>>my $sysdir=`%systemdrive%`;
>>>my $file ="$sysdir\\servicedisk\\tools\\seachange\\SeaPatch.exe";
>>>if(-e $file){ print "yes\n"; }else{ print "no\n"; }
>>>if(-e "$sysdir\\servicedisk\\tools\\seachange\\SeaPatch.exe"){ print
>>>"yes\n"; }else{ print "no\n"; }
> 
> 
> Here, you are explicitly opening a shell to get the environment
> variable.

Actually he's opening a shell and changing to the system drive
which does nothing on return.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to