Please explain what following code snippet could do in Perl script,
if (! -e '/etc/httpd') {
print "Something";
}
I can't find exact scenario or condition that makes this condition 'true'. This question also not explain much regarding this.
Exactly, what -e
switch does in this condition?
The -e filename
is one of filetests ("-X"), which checks for existence of a "file" (an entry, not only a plain file).
So the condition tests whether /etc/httpd
does not exist, since the unary operator !
does logical negation of what is on its right-hand side using Perl's rules for truth and falsehood.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With