summaryrefslogtreecommitdiff
path: root/lib/IPC
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 01:56:48 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-05-30 01:56:48 +0000
commitf06db76b9e41859439aeadb79feb6c603ee741ff (patch)
tree0898eb19feb17c3aa0ff6916fc182a998f1b9949 /lib/IPC
parentd1b918924020f633640d8b8cc8294856a82ddc04 (diff)
downloadperl-f06db76b9e41859439aeadb79feb6c603ee741ff.tar.gz
This is my patch patch.1g for perl5.001.
This patch only includes updates to the lib/ directory and the removal of the pod/modpods. The main things are the following: The modpods are now embedded in their corresponding .pm files. The Grand AutoLoader patch. Updates to lib/ExtUtils/xsubpp by Paul Marquess <pmarquess@bfsec.bt.co.uk>. Minor changes to a very few modules and pods. To apply, change to your perl directory, run the commands above, then apply with patch -p1 -N < thispatch. After you apply this patch, you should go on to apply patch.1h and patch.1i before reConfiguring and building. Patch and enjoy, Andy Dougherty doughera@lafcol.lafayette.edu Dept. of Physics Lafayette College, Easton PA Here's the file-by-file description: lib/AnyDBM_File.pm Embedded pod. lib/AutoLoader.pm Grand AutoLoader patch. Embedded pod. lib/AutoSplit.pm Grand AutoLoader patch. Embedded pod. Skip pod sections when splitting .pm files. lib/Benchmark.pm lib/Carp.pm lib/Cwd.pm lib/English.pm Grand AutoLoader patch. Embedded pod. lib/Exporter.pm Grand AutoLoader patch. Embedded pod. Update comments to match behavior. lib/ExtUtils/MakeMaker.pm Include installation of .pod and .pm files. Space out documentation for better printing with pod2man. lib/ExtUtils/xsubpp Patches from Paul Marquess <pmarquess@bfsec.bt.co.uk>, 22 May 1995. Now at version 1.4. lib/File/Basename.pm Embedded pod. lib/File/CheckTree.pm Embedded pod. lib/File/Find.pm Embedded pod. Included finddepth pod too. lib/FileHandle.pm Embedded pod. lib/Getopt/Long.pm Embedded pod. Fixed PERMUTE order bug. lib/Getopt/Std.pm Embedded pod. Caught accessing undefined element off end of @arg array. lib/I18N/Collate.pm lib/IPC/Open2.pm lib/IPC/Open3.pm lib/Net/Ping.pm Embedded pod. lib/Term/Complete.pm Embedded pod. Changed name from complete to Complete to match documentation and exported name. lib/Text/Abbrev.pm Embedded pod. lib/Text/Tabs.pm Updated. lib/integer.pm lib/less.pm lib/sigtrap.pm lib/strict.pm lib/subs.pm Embedded pod.
Diffstat (limited to 'lib/IPC')
-rw-r--r--lib/IPC/Open2.pm45
-rw-r--r--lib/IPC/Open3.pm25
2 files changed, 70 insertions, 0 deletions
diff --git a/lib/IPC/Open2.pm b/lib/IPC/Open2.pm
index c59c7d6897..71f89f35c2 100644
--- a/lib/IPC/Open2.pm
+++ b/lib/IPC/Open2.pm
@@ -3,6 +3,51 @@ require 5.000;
require Exporter;
use Carp;
+=head1 NAME
+
+IPC::Open2, open2 - open a process for both reading and writing
+
+=head1 SYNOPSIS
+
+ use IPC::Open2;
+ $pid = open2('rdr', 'wtr', 'some cmd and args');
+ # or
+ $pid = open2('rdr', 'wtr', 'some', 'cmd', 'and', 'args');
+
+=head1 DESCRIPTION
+
+The open2() function spawns the given $cmd and connects $rdr for
+reading and $wtr for writing. It's what you think should work
+when you try
+
+ open(HANDLE, "|cmd args");
+
+open2() returns the process ID of the child process. It doesn't return on
+failure: it just raises an exception matching C</^open2:/>.
+
+=head1 WARNING
+
+It will not create these file handles for you. You have to do this yourself.
+So don't pass it empty variables expecting them to get filled in for you.
+
+Additionally, this is very dangerous as you may block forever.
+It assumes it's going to talk to something like B<bc>, both writing to
+it and reading from it. This is presumably safe because you "know"
+that commands like B<bc> will read a line at a time and output a line at
+a time. Programs like B<sort> that read their entire input stream first,
+however, are quite apt to cause deadlock.
+
+The big problem with this approach is that if you don't have control
+over source code being run in the the child process, you can't control what it does
+with pipe buffering. Thus you can't just open a pipe to "cat -v" and continually
+read and write a line from it.
+
+=head1 SEE ALSO
+
+See L<open3> for an alternative that handles STDERR as well.
+
+=cut
+
@ISA = qw(Exporter);
@EXPORT = qw(open2);
diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm
index 3426f19111..8d324ccb62 100644
--- a/lib/IPC/Open3.pm
+++ b/lib/IPC/Open3.pm
@@ -3,6 +3,31 @@ require 5.000;
require Exporter;
use Carp;
+=head1 NAME
+
+IPC::Open3, open3 - open a process for reading, writing, and error handling
+
+=head1 SYNOPSIS
+
+ $pid = open3('WTRFH', 'RDRFH', 'ERRFH'
+ 'some cmd and args', 'optarg', ...);
+
+=head1 DESCRIPTION
+
+Extremely similar to open2(), open3() spawns the given $cmd and
+connects RDRFH for reading, WTRFH for writing, and ERRFH for errors. If
+ERRFH is '', or the same as RDRFH, then STDOUT and STDERR of the child are
+on the same file handle.
+
+If WTRFH begins with ">&", then WTRFH will be closed in the parent, and
+the child will read from it directly. if RDRFH or ERRFH begins with
+">&", then the child will send output directly to that file handle. In both
+cases, there will be a dup(2) instead of a pipe(2) made.
+
+All caveats from open2() continue to apply. See L<open2> for details.
+
+=cut
+
@ISA = qw(Exporter);
@EXPORT = qw(open3);