Operating System - Linux
1752777 Members
5930 Online
108789 Solutions
New Discussion юеВ

Re: Test for if statement in Perl

 
SOLVED
Go to solution
Jeff_Traigle
Honored Contributor

Test for if statement in Perl

This will be super-elementary for the Perl gurus I know frequent the forums. What is this if statement doing? I'm guessing it tests if a directory is empty, but I have been totally ineffective finding documentation online regarding the test parameters for if statements?

if (-e "/var/adm/checkperms")
--
Jeff Traigle
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Test for if statement in Perl

-e => existence of a file
If it ain't broke, I can fix that.
Jeff_Traigle
Honored Contributor

Re: Test for if statement in Perl

Hmm... Interesting. That doesn't make much sense in the context of the script I'm looking at, but it wouldn't be the first time that's happened. Thanks.
--
Jeff Traigle
Jeff_Traigle
Honored Contributor

Re: Test for if statement in Perl

Thanks
--
Jeff Traigle
A. Clay Stephenson
Acclaimed Contributor

Re: Test for if statement in Perl

Oh, these operators are described in the perlfunc man page and to save you a little time digging through all the pages do:
man perlfunc
/-X EXPR
that search will put you in the neighborhood.
If it ain't broke, I can fix that.