develooper Front page | perl.perl5.porters | Postings from October 2013

[perl #120077] perlfunc -X misleading about return values

Thread Previous
Victor Efimov
October 2, 2013 12:54
[perl #120077] perlfunc -X misleading about return values
Message ID:
# New Ticket Created by  Victor Efimov 
# Please include the string:  [perl #120077]
# in the subject line of all future correspondence about this issue. 
# <URL: >

> Unless otherwise documented, it returns 1 for true and '' for false, or
the undefined value if the file doesn't exist.

$ ls -la /root/perl5
ls: cannot access /root/perl5: Permission denied

$ perl -e 'defined(-e "/root/perl5") or die $!'
Permission denied at -e line 1

That file exists, however "-e" test returned undef. And I don't see any
other documentation for -e return value on that page.

(I suspect it returns undef in case of any system error and sets $!)

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