Front page | perl.perl5.porters |
Postings from October 1999
From: Jenda Krynicky
October 26, 1999 12:37
Message ID: OF976537B9.545160EC-ONC1256816.006BBCE3@mccann.cz
I'd like to propose a few additions to Shell.pm module.
1) I think there should be not only $Shell::captureSTDERR, but also
$Shell::dropSTDERR (not sure what name to choose) that would cause
the STDERR of the program to go to /dev/null (whatever the syntax is
for your OS).
2) I don't realy like those GLOBAL switches. I think we could allow
something like :
*ls = new Shell 'ls', STDERR => 0;
Where say "STDERR => 0" means "Don't care about STDERR",
"STDERR => 1" means "Capture STDERR" and "STDERR => -1" means
"Drop STDERR to /dev/null".
3) With this syntax we may even add some preset parameters:
*SendMsg = new Shell 'net', -PARAMS => 'send';
SendMsg 'jkrynicky', "Hi, are you there?";
would be equivalent to calling
net send jkrynicky "Hi, are you there?"
We could even have things like
*foo = new Shell 'foo', -PARAMS => '/bar $1 /baz $2';
foo 'Jenda', 'Krynicky';
foo /bar Jenda /baz Krynicky
4) When we are at it we might add even one more handy feature, we
could allow the user to specify that one of the parameters (the last
one) is to be sent on the programs STDIN, not included on the
*sendmail = new Shell 'sendmail', -params => '-t', -STDIN => 1;
Blah blah blah
would do the right thing, on any OS (as long as you have a
commandline sendmail installed of course.)
Sure, you may do all this with IPC::Open2 and IPC::Open3 and others,
this would just provide the user with a simple and PORTABLE
I'm willing to write the patch, at least for Win32 and Unix (don't
have access to other OSes), but I would like to get some comments
before I start coding.
== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==
The phenomenon of UFO doesn't say anything about
the presence of intelligence in space.
It just shows how rare it is here on the earth.
by Jenda Krynicky