But when processing each line, I am only aware of the pid and not the process running
That's why I changed to a hash of arrays to store the PIDs and process information. You can get the program name by $pid{$fh}[1], or put more information into that array as necessary.
Update: your question about -| can be fully answered by reading open's documentation. The short answer is it opens a process for reading.
In reply to Re^3: forking and monitoring processes
by revdiablo
in thread forking and monitoring processes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |