sbnation
sbnation

Reputation: 149

I don't understand Perl's "-e" operator

I see Perl scripts using -e, for example unless -e

I understand the unless loop, but not the -e part. An explanation would be nice. When should -e be used?

Upvotes: 6

Views: 10485

Answers (2)

Miller
Miller

Reputation: 35198

That's testing if a file exists

Check perldoc -f -X

Upvotes: 1

nitekrawler
nitekrawler

Reputation: 425

It's to check if a file exists.

http://perldoc.perl.org/functions/-X.html

Upvotes: 8

Related Questions