Everything2
Near Matches
Ignore Exact
Full Text
Everything2

-p

created by Slay

(idea) by avjewe (24.1 min) (print)   ?   (I like it!) Fri Apr 06 2001 at 15:14:50

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.


printable version
chaos

The -P convention =P addiction Hello. How are you? I am fine. What is your name? My name is Jerry. :-P
named pipe The Jargon File file test operator my first perl program
talk mode :-) fuel up -n
SED one liner Perl nil
pot
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Just another sprinkling of indeterminacy
Mayan Calendar
Windows 1.x
How to tenderize an octopus
Perl
Michelangelo
Chinese Dynasties
augmented triad
Jonathan Sidney Phillips
Sal Mineo
Webster 1913 is a fake
Aspects of American society that may be new to you
Thailand
¡MULTIPLE ORGANISMS!
New Writeups
The Jacket
Words of Advice(idea)
keepinitreal
Why buy the cow when you can get the milk for free?(idea)
John_Fox
Good Intentions Gone Wrong(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
etouffee
Wild tides guard her secrets(poetry)
This affordable entertainment brought to you by The Everything Development Company