Hi Alex It seems you have a typing error, see in-line. However I don't see how this would cause your problem. I would make sure you have entered your path and file name correctly. (How about copying and pasting directly from a directory listing?)
Apart from that, how about writing your code as: $workDir = "/usr/local/home/tkcheung/systemadmin/singlesar/Report"; $path = "tulisar030108.rpt"; return ! -e "$workDir/$path"; HTH, Rob "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; ^^^^^^^^ Appears below as $notAvailable. > $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]