in reply to Question about input pipes and sub-shells
This guarantees there won't be copy of the shell involved, so shell metacharacters in the search string are irrelevant.my $pid = open(PIPE, '-|'); if (!defined($pid)) { die "fork failure: $!\n"; } elsif (!$pid) { # Child process exec 'search', $pattern; die "exec failure: $!\n"; } else { # parent ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Question about input pipes and sub-shells
by blakem (Monsignor) on Nov 15, 2001 at 00:02 UTC |