John Rambo John Rambo - 5 months ago 16
Perl Question

What does -e mean in an if statement?

I found the following in some Perl code:

if (! -e $options{"inPath"}){
$logger->fatal("Directory \'$options{\"inPath\"}\' does not exist.\n");

What does the
in the
statement do?


See Perl file tests in the online perl documentation site. -e '/foo' returns true if the file /foo exists.

You can access it also from the command line if you have perldoc installed in your system.

perldoc -f -X