user623990
user623990

Reputation:

How do I check if file is a named pipe in perl?

Kind of like:

-e /path/to/file or die "file doesn't exist";

Is it possible to do something like:

-p /path/to/pipe or die "not a valid pipe";

Upvotes: 1

Views: 934

Answers (1)

Platinum Azure
Platinum Azure

Reputation: 46193

You can indeed use -p (see perlfunc for all the filetest operators available in Perl).

Upvotes: 5

Related Questions