![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple issue.. | the_learner | UNIX for Advanced & Expert Users | 2 | 01-17-2008 01:44 PM |
| SSH in batch mode and File-Handles in a loop | DaveCutler | Shell Programming and Scripting | 3 | 04-03-2007 03:39 AM |
| PIPEs and Named PIPEs (FIFO) Buffer size | Jus | Filesystems, Disks and Memory | 1 | 08-20-2004 07:14 AM |
| File Handles | sjaeger | UNIX for Advanced & Expert Users | 3 | 08-10-2001 04:58 AM |
| Perl, Pipes, and FTP | murdaugh | UNIX for Dummies Questions & Answers | 2 | 07-03-2001 05:01 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
perl help with pipes and file handles (simple issue)
Hello,
I have a program which opens a pipe for communication using file handle and forks 5 child processes. Code:
@waitlist = (1,2,3,4,5);
foreach $item (@waitlist) {
pipe *{$item},RETHAND;
unless ($pid = fork()) {
# Child process
print RETHAND "Completed $item\n";
exit();
}
}
# back to parent...
foreach $item (@waitlist) {
$response = <$item>;
print "$response";
}
Quote:
so in my child process f I have.. Quote:
Quote:
can someone please help me out here ? Thanks ! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
What about this?
Code:
@waitlist = (1,2,3,4,5);
foreach $item (@waitlist) {
pipe *{$item},RETHAND;
unless ($pid = fork()) {
# Child process
print RETHAND "Completed $item\n something else here";
exit();
}
}
close(RETHAND);
# back to parent...
foreach $item (@waitlist) {
@response = <$item>;
print @response, "\n";
}
|
|||
| Google The UNIX and Linux Forums |