It works for me on files but not directories and (of course:) -f and/or -d 
don't work, which would allow you to check for that possibility, and 
prevent it from happening. Which means it has very limited utility because 
there's a always a "possibility" lurking in the code.

Is there any chance a directory is slipping in there? The . and .. that are 
there for quick cd from the command line can cause trouble too.

In any case, it might help to print out exactly what it's failing on.

ms



At 08:07 AM 8/20/02, you wrote:
>I just upgraded to ActivePerl 5.6.1 Build 633 from ActivePerl 5.00503.  I
>was using the file operator -e to check if a file existed this use to work
>fine.  But since I up graded the code does not work.  Has anyone ran into
>this problem and what is the fix. The code is as follows.
>
># common screen program $ReportName is passed from programs
>sub ReportNameIn{
>   $Question = "%3F";
>   $Slash    = "%2F";
>
>   $SupDir = index($ReportName,"Sup");
>
>   @ReportName = split(/\//,$ReportName);
>   $DirName    = @ReportName[3];
>
>   @ReportName = split(/\?/,$ReportName);
>   $ReportNamex = @ReportName[1];
>
>
>   $ReportNamex =~s/%2F/\//g;
>   $ReportNamePass = "c:/inetpub/cgi/".$ReportNamex;
>
>   if (-e $ReportNamePass){
>   } else {
>
>    $ReportNamePass = "c:/inetpub/cgi/".$DirName."/htm/".$ReportNamex;
>    if (-e $ReportNamePass){
>    } else {
>       if ($SupDir > 0){
>         $ReportNamePass =
>"c:/inetpub/cgi/".$DirName."/htm/sup/".$ReportNamex;
>       } else {
>            if ($DirName eq 'Doc') {
>         $ReportNamePass = "c:/inetpub/cgi/".$DirName."/".$ReportNamex;
>            }else {
>         $ReportNamePass = "c:/inetpub/cgi/".$DirName."/htm/".$ReportNamex;
>        }
>           }
>       if (-e $ReportNamePass){
>       } else {
>          print "****CAN NOT OPEN".$ReportNamePass;
>         die;
>      }
>    }
>   }
>
>   @IFile=<IFile>;
>   close IFile;
>
>$ReportNameXlsIn = $ReportNamePass;
>$ReportNameXlsIn =~ s/\.htm/\.xls/;
>$ReportNameHrefIn = $ReportNameXlsIn;
>if ($DirName eq 'Doc') {
>  $ReportNameHrefIn =~ s/c\:\/inetpub/https\:\/\/gopax/;
>} else {
>  $ReportNameHrefIn =~ s/c\:\/inetpub\/cgi/https\:\/\/gopax/;
>}
>}
>1;
>
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to