in reply to Re: I may be remotely depressed.
in thread FTP question
brassmon_k, you are referring to opening a pipe to read process output. Unfortunately the syntax you suggest is the one for *supplying input* to the subprocess, which is not a common usage of pipes (your pipe character is the *first* character of the command).
Far more common is to run a command producing output which the perl code must process, using the pipe character ('|') as the *last* character of the command (e.g., open PH, "shell command|".).
Sample code follows:
open PH, "ps -ef|" or die "$!: opening pipe"; while (<PH>) { # retrieves output from "ps" command one line at a ti +me # .. process output--each line is $_ .. } close PH or die "$!: error closing pipe";
dmm
You can give a man a fish and feed him for a day ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re(2): I may be remotely depressed.
by brassmon_k (Sexton) on Jan 03, 2002 at 00:31 UTC | |
by brassmon_k (Sexton) on Jan 03, 2002 at 00:42 UTC | |
by dmmiller2k (Chaplain) on Jan 03, 2002 at 00:59 UTC |