Alex Cheung Tin Ka wrote:
> Dear All,
> I have a problem on using CGI to check the file existence in a directory. Here
>is my code
>
> $workDir = "/usr/local/home/tkcheung/systemadmin/singlesar/Report";
> $path = "tulisar030108.rpt";
> $notAvailabe = 0;
> $a = qq`$workDir/$path`;
> if (! -e $a){ $notAvailable = 1;}
> return $notAvailable;
>
> The file does exist, but the code always return 1;
> I do try to install the module Test::File (but failed) and using open file to
>test the file existence ( it works)
>
> I would ike to know how to use the "-e" to check it.
>
> Regards,
> Alex
>
DO $a = "$workDir/$path";
instead of $a = qq`$workDir/$path`;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]