develooper Front page | perl.beginners | Postings from May 2007

Re: Inconsistent results from file test (-X) operators

Thread Previous
Chas Owens
May 16, 2007 18:35
Re: Inconsistent results from file test (-X) operators
Message ID:
On 5/16/07, R (Chandra) Chandrasekhar <> wrote:
> Can anyone please tell me why I get this inconsistent behaviour and how to
> overcome it?

It is not inconsistent, you are using file names without the proper
path.  If a file or directory exists in the current directory with the
same name as one in /usr you will get a result, otherwise there is no
file, so you are told false for both.  You can fix your code by either
prefixing the file name with the directory or doing chdir() into

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About