Troy May wrote:
I have this line in one of my scripts:

if ( $pid = open( SWISH, '-|' ) )
Why am I opening -|? And what is it?

Well it is rope to hang yourself with ;-)... more required reading:

perldoc perlopentut

(Don't you just hate it when its in the manual?)

From the above:

"The Minus File

Again following the lead of the standard shell utilities, Perl’s "open"
function treats a file whose name is a single minus, "-", in a special
way.  If you open minus for reading, it really means to access the
standard input.  If you open minus for writing, it really means to
access the standard output.

If minus can be used as the default input or default output, what hap-
pens if you open a pipe into or out of minus?  What’s the default com-
mand it would run?  The same script as you’re currently running!  This
is actually a stealth "fork" hidden inside an "open" call.  See "Safe
Pipe Opens" in perlipc for details."

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to