Magius_AR has asked for the wisdom of the Perl Monks concerning the following question:
I've basically coded everything except the |,<, and > operators.
These are a bitch, because I hate dealing with pipes that refuse to be bi-directional. I think the solution has something to do with something called "dup"ing, though I haven't a clue how.
To explain more specifically, say I'm trying to code the "<" operator...I have to get something like
wc < sometext
to output the right thing, but I can't use the "<" opeartor in my code itself. Thus here's my attempt so far:
open (PIPE,"| $path/$command >&RESULT"); print PIPE @data; close(PIPE); @result = <RESULT>;
This is course doesn't work at all, but maybe it gives u an idea of what I need. I have to be able to pass @data (like sometext) in a given command (like wc) and capture the result in an array (@result). I've tried soooooo many different things and keep failing. I am at your mercy :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dup & redirecting filehandles
by Adam (Vicar) on Oct 22, 2000 at 21:10 UTC | |
|
Re: Dup & redirecting filehandles
by AgentM (Curate) on Oct 22, 2000 at 21:53 UTC | |
|
Re: Dup & redirecting filehandles
by Fastolfe (Vicar) on Oct 24, 2000 at 18:50 UTC | |
|
Re: Dup & redirecting filehandles
by Anonymous Monk on Oct 22, 2000 at 21:37 UTC | |
by Fastolfe (Vicar) on Oct 24, 2000 at 18:47 UTC |