John Rambo John Rambo - 1 year ago 77
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?

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download