Luiz de Andrade Luiz de Andrade - 2 years ago 80
Perl Question

What does "-e" do inside an expression in Perl?

I ran into this piece of code:

unless(-e $SNMPWALK)
print "snmpwalk is not installed!\n";
exit 3;

What is the function of
in this expression?

Answer Source

It's one of the file test operators. In this case it tests whether the file whose name is in $SNMPWALK exists

It's documented in perlfunc under perldoc -X

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download