Try this

unless  (-f $a) { $notAvialible = 1 }

=====================================================
"Alex Cheung Tin Ka" <[EMAIL PROTECTED]> wrote in message
021501c2b791$0c935bc0$[EMAIL PROTECTED]">news:021501c2b791$0c935bc0$[EMAIL PROTECTED]...
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




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

Reply via email to