One of the Perl file test operators.

(-p $file) returns true if the file exists, and it is a named pipe (i.e. not a directory, special file, named pipe, plain file or symbolic link.


As a command line option, -p behaves rather like it does in sed, which is to say it wraps your code in a loop like this :
while (<>) {
   #your code
   print;
}
If you don't want the "print" use -n instead.

BEGIN and END blocks may be used to do things before or after this loop (e.g. initializing variables) much like in awk.

Log in or register to write something here or to contact authors.