HDTenEightyP/NetNews huggingface dataset:
From: rm55+@pitt.edu (Rudolph T Maceyko)
Newsgroups: comp.lang.perl
Subject: Re: dosperl-4.035 problems
Keywords: dos perl-4.035 broken?
Date: 29 Jul 92 18:25:24 GMT
Organization: University of Pittsburgh

In article <3772@blue.cis.pitt.edu.UUCP>, rm55+@pitt.edu (Rudolph T Maceyko) writes:
# Has anyone had trouble with dosperl-4.035 (the DJGPP one found in
# ftp.umanitoba.ca:/pub/msdos/perl/perl386.zoo)?

I should point out that this is a typo on my part.  The ftp host is
actually ftp.ee.umanitoba.ca, as listed in the FAQ.
             ^^

In article <Bs4Goy.11E@jrd.dec.com> doi@jrd.dec.com (Hitoshi Doi) writes:
>I think there must have been some bugs in DJGPP's library functions.
>(I'm using 1.05 because 1.06 and 1.07 do not run on my machine..)
>
>When I eliminated the HAS_REWINDDIR, HAS_SEEKDIR, and HAS_TELLDIR
>from config.h, most of the problems were solved.
>I still kept HAS_READDIR.  (Because I need it:-)

Hmm..  I assume that means that these functions will not be available.
Oh well, I guess...

>I will upload the new version in a couple days.

Thanks Hitoshi.

Rudy
-- 
Rudy Maceyko
<rm55+@pitt.edu> or <rtm+@cmu.edu>
Pittsburgh, Pennsylvania USA
From: lemson@fnbc.com (David Lemson)
Newsgroups: comp.lang.perl
Subject: Re: getting started
Date: 23 Jul 92 19:39:38 GMT
Reply-To: lemson@fnbc.com
Organization: First National Bank Of Chicago, Chicago IL, USA

In article <1992Jul22.212350.12051@tamsun.tamu.edu> rse8135@dewie.tamu.edu  
(R.S. Etheredge) writes:
> Howdee,
> I am a brand new introductee to the wilds of perl. I have purchased an  
> O'Rielly & Associates book entitled Programming perl, by Larry Wall and  
> Randall Schwartz. I have just started reading the Getting Started  
chapter.  
> Anybody have experiences to help accellerate the learning curve?

I always find it helps to have someone telling me 'I want that program  
written today or you're fired!'

No, seriously, think of something you want to do and write a Perl program  
to do it... start out writing an automated FTP program or something fairly  
simple like that. (just give commands to the ftp program read in from a  
file or something) The thing about Perl is that you can write a really  
simple program in no time, and add things to it (like CURSES calls!) as  
you go.
--
David Lemson                                           (312) 732-4741
FNBC Sys Admin (Summer) UIUC NeXT Campus Consultant(rest of the time)
E-mail to: lemson@fnbc.com                          NeXTMail accepted
From: toro.MTS.ML.COM!scott%beethoven@uunet.uu.net (Scott Strool)
Newsgroups: comp.lang.perl
Subject: @ARGV
Date: 31 Jul 92 00:39:11 GMT
Reply-To: Scott Strool <toro.MTS.ML.COM!scott%beethoven@uunet.uu.net>
Organization: The Internet

How can I get the individual characters from the command line variable.
for instance if the user entered 'xbr'. I want to know that the first char
is 'x', second is 'b' and third is 'r'.

thanks,
srs
Scott Strool
Consultant
Merrill Lynch & Co Inc.
Tel: (212) 449-1456
Fax: (212) 449-1465
scott@ml.com
uunet!toro!scott
From: wierda@ltb.ltb.bso.nl (Gerben Wierda)
Newsgroups: comp.lang.perl
Subject: curseperl on Ultrix 4.2a?
Date: 22 Jul 92 10:10:30 GMT
Organization: BSO/LT, Baarn, The Netherlands

I tried to link/compile curesperl on Ultrix 4.2a and I got all kinds of
unresolved externals. I used bsdcurses.mus and changed termlib in the
usub/Makefile to termcap (as stated in the curses man page). Still, I get
unresolved externals like "baudrate", "idlok" etc.

What am I forgetting here? Or is Ultrix again non-standard....?

-- 
wierda@ltb.bso.nl (Gerben Wierda) || I speak for myself and not for my employer.
(+31) 2154 84415/(+31) 35 833539  || Support the League for Programming Freedom!
	"If you don't know where you are going, any road will take you there."
	Lewis Carroll, "Alice in Wonderland".
From: ej@id.dth.dk (Erik Johansen)
Newsgroups: comp.lang.perl
Subject: How do I make 'stty -echo' work from a net service
Date: 29 Jul 92 07:35:46 GMT
Organization: Department of Computer Science

In a perl program I need to request a username without
echoing it.  This works fine when I am running it from a shell.

I intend to run it from a tcp net service (/etc/services) but
here it will not disable echoing ("Not a tty").

I suppose that solving the above problem involves creating a pty
but I do not know how to do it.

Any ideas of how to code this ?


---
 $txt=" ltrterhnuc--sor eep-\nkJ.a "; srand(53747414);
 for (1..26) { print substr($txt,rand 27,1); }  ### Is this a random write ?
-- 
---
Erik Johansen                  E-mail: ej@id.dth.dk
Institute for Computer Science, Copenhagen, Denmark
Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: why is this illegal ??
Originator: tchrist@convex.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Fri, 31 Jul 1992 11:48:14 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of henkp@cs.ruu.nl (Henk Penning):
:Perl prog:
:-----------------------------------------------
:# why is this illegal ??
:
:$res = ( -f ? 'hip' : 'hop' ) ;
:
:# what I try to do is: grep plain files from a directory and save the stats
:# @res = grep( ( -f ? ( $f{$_} = join($;,stat(_)) ) : 0 ) , readdir(DIR) ) ;
:-----------------------------------------------

Because sometimes you can't let the operand default.  

    $res = ( (-f $_) ? 'hip' : 'hop' ) ;

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

            /* dbmrefcnt--;  */     /* doesn't work, rats */
        --Larry Wall in hash.c from the perl source code
From: rm55+@pitt.edu (Rudolph T Maceyko)
Newsgroups: comp.lang.perl
Subject: Re: BUG? in 4.035: length($`) is strange
Date: 29 Jul 92 22:07:19 GMT
Organization: University of Pittsburgh

In article <1992Jul29.213032.11414@ugle.unit.no> harald.alvestrand@delab.sintef.no writes:
>Environment: Sun-4, SunOS 4.1.1, cc used for compilation.
>Also fails on HP-UX 8.0.whatever, HP-710 (different length, thou....)
.
.
.
>Result of run with PERL version 4.0, patchlevel 35:
>
>Indent set to 475080, length of   0049    56 |  |  |  
>Len set to 22, length of   0049    56 |  |  |  
>
>Result of run with PERL version 3.018:
>
>Indent set to 22, length of   0049    56 |  |  |  
>Len set to 22, length of   0049    56 |  |  |  

Environment: DECstation 2100 & 5000, Ultrix 4.2 and 4.2A,
gcc used for compilation

Result of run with perl-4.035:
Indent set to 0, length of   0049    56 |  |  |
Len set to 22, length of   0049    56 |  |  |

Result of run with perl-4.019:
Indent set to 22, length of   0049    56 |  |  |
Len set to 22, length of   0049    56 |  |  |


Result of run with perl-4.035 on SunOS 4.1.2 IPX:
Indent set to 386568, length of   0049    56 |  |  |
Len set to 22, length of   0049    56 |  |  |


I haven't had the chance to try this one on dosperl-4.035 yet.

Rudy

-- 
Rudy Maceyko
<rm55+@pitt.edu> or <rtm+@cmu.edu>
Pittsburgh, Pennsylvania USA
Newsgroups: comp.lang.perl
From: flee@cs.psu.edu (Felix Lee)
Subject: Re: Truncating or rounding "floats" and bug with ($_==int?2:3)
Date: Wed, 29 Jul 1992 07:07:18 GMT

Erik E. Rantapaa:
> BTW, the following gives a syntax error (SunOS, patchlevel 19):
> ( $_==int ? 2 : 3)

That's because 'int' expects an argument, and '?' in an argument
position is the '?PATTERN?' operator, not the '?:' operator.

Perl 4.0 pl 35 gives this message for the above statement:
> Warning: Use of "int" without parens is ambiguous at - line 1.
> Search pattern not terminated in file - at line 1, next char ^?
> syntax error in file - at line 2, next char ;
--
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: # of files in directory
Originator: tchrist@pixel.convex.com
Keywords: Files, Perl, Directory, ls
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Thu, 23 Jul 1992 22:57:15 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of bobd@magnus.acs.ohio-state.edu (Bob DeBula):
:In article <1992Jul23.201539.4416@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
:>From the keyboard of bobd@magnus.acs.ohio-state.edu (Bob DeBula):
:>:To reduce it still further (this *is* PERL after all):
:>:
:>:opendir (FILE, "/usr/bin");
:>:print "There are ", scalar(grep (!/^\./, readdir (FILE))), " files!\n";
:>:
:>:Now if I could just figure out how to embed the open in the print
:>:statement.....
:>
:>print "There are ", scalar grep(1,`ls /usr/bin/`), " files in /usr/bin.\n";
:				   ^^^^^^^^^^^^^^
:				   But, that would 
:				   be *cheating* :-)
:				
:
:Actually, how does this compare in efficiency to the "opendir"
:method? (My timings would seem to indicate that the "opendir" form
:is slightly (almost infintesimally) faster on my Sun 3/80).

Right -- depends on your system and the phase of the moon.

On mine, opendir() is method 1, `ls` is method 2, and I ran 100
iterations:

    method 1:   1.1500u   0.2333s
    method 2:   1.0667u   0.6833s

:While the goal is to get it down to one line, you must color
:in the lines (stay within PERL that is :-). So, can you do it
:in one line *without* using any semi-colons or backquoting
:to use external utilities? 

Surely.  

    print "There are ", 
	    scalar(opendir(F,"/usr/bin"),scalar(grep(!/^\./,readdir(F)))), 
	" files!\n"

You can join these into one line if you'd like.

:Think of it as one of those penultimately
:pointless PERL challenges which crop up from time to time :-)

Sigh, pretty as it sounds, I lament to inform you that penultimate doesn't
mean more than ultimate.  Ultimate often means last in modern dialects of
Latin.  Penultimate means second to the last, and antepenultimate means
third to the last.

:Hmmm, "Penultimately Pointless PERL Programming Problem" sounds
:like some sort of invitational named by Robin Leach, doesn't it? 
:What would we give for a prize to the winner of the 1st PPPPP 
:Invitational? Maybe we could get Larry to donate some "suitable 
:for framing" original napkins with PERL patches scribbled on them 
:(complete with obligatory coffee stains)?

But I do like the idea.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
    Besides, including <std_ice_cubes.h> is a fatal error on machines that
    don't have it yet.  Bad language design, there...  :-)
            --Larry Wall in <1991Aug22.220929.6857@netlabs.com>
Xref: sparky comp.lang.perl:4846 comp.emacs:2661
From: dltest@castle.ed.ac.uk (Kevin Davidson)
Newsgroups: comp.lang.perl,comp.emacs
Subject: Perl/Nroff mode for GNU Emacs ??
Keywords: perl GNUemacs nroff
Date: 21 Jul 92 15:20:35 GMT
Organization: Edinburgh University


I'm using the Wrapman utility from the camel book to merge code
and manual page into the same file, but now of course I can't decide
whether to use perl-mode or nroff-mode (electric-nroff-mode)
based on the filename OR local variables.

I can get one, and switch between them (M-x nroff-mode etc.), but it's a pain.

What I'm asking is...
has anyone merged perl-mode and nroff mode such that a couple of keypresses
will narrow the file to the perl part and switch to perl-mode, and
a couple more will narrow to the manual page part and switch to nroff-mode.

I don't trust my elisp enough to do this myself...

dltest@castle.ed.ac.uk
Xref: sparky comp.lang.perl:4879 comp.unix.aix:8063
From: dla@se05.wg2.waii.com (Doug Acker)
Newsgroups: comp.lang.perl,comp.unix.aix
Subject: PLUM under AIX
Date: 22 Jul 92 16:57:26 GMT
Reply-To: acker@se01.wg2.waii.com
Followup-To: comp.lang.perl
Organization: Western Geophysical Exploration Products

Has anyone gottten PLUM to work under AIX? I can't get the sysconf.pl
file right ....

-- 
Douglas L. Acker

Western Geophysical Exploration Products
Systems Engineer

Email (internal):  acker                Phone:  713-964-6128
      (Internet):  acker@wg2.waii.com
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: or puzzlement
Date: 23 Jul 92 19:12:43 GMT
Organization: NetLabs, Inc.

In article <BrtMFu.D0L@unx.sas.com> kent@manzi.unx.sas.com (Paul Kent) writes:
: 
: 
: hi,
: 
: in some sub xx, i currently do the moral equivalent of:
: 
: sub xx
: {
:   opendir(D,$f) || warn "no dir $f" || return 1;
: }
: 
: which to my app is a non-fatal warning -- typically my outer loop
: will do 
: 
:   &sub() && next;
: 
: 
: 
: 
: is it guarenteed that warn <stuff> will evaluate
: to 0/false forcing the next thing in the or-sequence to be
: evaluated, or am i just getting "lucky" (warn in the camel
: book doesnt describe its result -- it may be grandfathered
: elsewhere....)

Actually, warn always returns true, but the reason the return is never
evaluated is that "no dir $f" is always true, and warn is a list
operator.  You're getting lucky.

What you really want to say is

    opendir(D,$f) || warn("no dir $f") && return 1;

It works out nicely that && binds tighter than ||.  On the other hand,
it may be clearer to say

    opendir(D,$f) || do {warn "no dir $f"; return 1};

or

    opendir(D,$f) || (warn("no dir $f"), return 1);

Since warn returns 1, you should even be able to say

    opendir(D,$f) || return warn "no dir $f";

That doesn't work for "next" though.

Larry
Xref: sparky comp.lang.perl:4976 comp.sys.ncr:400
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl,comp.sys.ncr
Subject: Re: Problem compiling Perl 4.035 on NCR Tower
Date: 27 Jul 92 19:07:34 GMT
Organization: NetLabs, Inc.

In article <1992Jul26.222725.25554@tssi.com> nolan@tssi.com writes:
: While compiling perl 4.035 on an NCR Tower/450 SVR2 (2.01.00), I get the
: following error:
: 
: Assembler: teval.c
: 	aline 9708	: short switch table span exceeded.
: 
: Any suggestions on how to get around this would be appreciated.

Try recompiling that file with -DSMALLSWITCHES

Larry
Newsgroups: comp.lang.perl
From: bobd@magnus.acs.ohio-state.edu (Bob DeBula)
Subject: Re: # of files in directory
Keywords: Files, Perl, Directory, ls
Organization: The Ohio State University
Date: Fri, 24 Jul 1992 15:38:38 GMT

In article <1992Jul23.225715.21531@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of bobd@magnus.acs.ohio-state.edu (Bob DeBula):
>:In article <1992Jul23.201539.4416@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>
>Sigh, pretty as it sounds, I lament to inform you that penultimate doesn't
>mean more than ultimate.  Ultimate often means last in modern dialects of
>Latin.  Penultimate means second to the last, and antepenultimate means
>third to the last.
>

In common usage, I have always heard "penultimate"  utilized 
to mean something like "super ultimate" or "ultimate plus". Obviously
this was incorrect given Tom's knowledge of Latin. How in the world can
Tom be a PERL wizard of penultimate magnitude (we`ll sandwich Larry
in as the "Ultimate" using Tom's definition) and still know
modern derivational Latin? Does the man sleep? What do these folks
do in their spare time one wonders (indeed, how could they *possibly*
have any spare time)? :-) :-) :-)

Of course, "penultimate" in my intended usage has about as much meaning
as "new improved super infinity" or "infinity to the infinite power",
but that was my intention. :-) :-)

I guess I could live with conceding that it might have some
infinitesimal pointfulness (or be slightly less pointless than
something else) in order to keep the name the "Penultimately 
Pointless PERL Programming Problem".


Me: "Arggghh!, They got me!"

P'hacker: "Who, the police, space aliens, miniature poodles? Who *was* it man?!?"

Me: "No, the semantics!"

-- 
==========================================================================
              Disclaimer: These are my views, not the U's

        "If it's in the paper it must be true!" --- D. Doright 
Newsgroups: comp.lang.perl
From: bob@kahala.soest.hawaii.edu (Bob Cunningham)
Subject: Capitalizing words?
Originator: bob@kahala
Organization: School of Ocean and Earth Science and Technology
Date: Wed, 22 Jul 1992 17:53:27 GMT

Surely there must be a nice little perl idiom to capitalize
lists of words, but I just can't seem to discover it.

How do you do it?
-- 
Bob Cunningham
bob@soest.hawaii.edu
School of Ocean & Earth Science & Technology, University of Hawaii
From: rjc@onion.princeton.edu (Raymond Chen)
Newsgroups: comp.lang.perl
Subject: Perl and low-memory environments
Date: 28 Jul 92 16:40:57 GMT
Organization: Princeton University

Although perl was written for 32-bit virtual memory UNIX boxes,
many of us use it on 16-bit low-memory machines like IBM PC's.
(Beyond spec, I know, but hey.)

I'm wondering if any of my MS-DOS brethren have any space-saving
tips to share.  I'm already using the following tricks:

  - Use the symbol table as an associative array.
  - Don't load subroutines until they're needed.
  - Discard subroutines when they're no longer needed.

But that's still not enough.  I'm thinking of moving all of main
into subroutines so that I can discard bits and pieces of main as
they are no longer needed.

Has anyone had experience tuning code for low-memory machines?
--
for(split(//,"_rekcah_lrep_rehtona_tsuJ")){eval"sub $}$_{'$_'.&$};}";$}.=$_;}$_=&$}.",";y/_/ /;print;
Newsgroups: comp.lang.perl
From: tanaka@til.til.com (Yokichi Tanaka)
Subject: Re: Bug in split(/\W+/) with "*" or "+" in input. 
Organization: Togai InfraLogic, Inc.
Date: Tue, 21 Jul 1992 23:58:48 GMT

In article <1992Jul18.052238.3430@news.belwue.de>, wschmidt@commix (Wolfram Schmidt) writes:
|> In article <1992Jul17.235506.25157@newsgate.sps.mot.com> dichter@chdasic.sps.mot.com (Carl Dichter) writes:
|> >There seems to be a bug in split, when using repeating whitespace as separator,
|> >and input data contains apostrophes or plus signs.
|> >
|> >	($pt1, $pt2, $pt3, $pt4, $pt5, $pt6) = split(/\W+/);
|> 
|> Use
|> 	($pt1, $pt2, $pt3, $pt4, $pt5, $pt6) = split;
|> 	($pt1, $pt2, $pt3, $pt4, $pt5, $pt6) = split(/\s+/);
|> 	($pt1, $pt2, $pt3, $pt4, $pt5, $pt6) = split(/[ \t]+/);
|> if you want to keep the newlines.
|> 
|> -Wolfram
|> -- 
|> wschmidt@iao.fhg.de Tel.: IAO: 0711/970-2431, Uni: 0711/121-3806

I always use:
               ($x, $y) = split(' ');

Otherwise, leading whitespaces will result in a null first record (unless
in cases where such behavior is desirable).

-- 
Yokichi (Yoke) Tanaka      Togai InfraLogic, Inc.    "fuzzy"
tanaka@til.com             Irvine, California, USA
uunet!til!tanaka           714-975-8522
"The more you drive, the less intelligent you are."
Newsgroups: comp.lang.perl
From: Al Gaspar <gaspar@stepsun.army.mil>
Subject: Problems compiling 4.035 under UTS
Reply-To: gaspar@stepsun.army.mil
Organization: The Internet
Date: Fri, 31 Jul 1992 11:59:13 GMT


My mailer seems to be having problems talking to our name server so I am 
resending this.  My apologies if it did make it before...

    I decided to upgrade perl on an Amdahl running UTS from 4.019 to
4.035.  I told it to use the malloc that comes with perl, and it failed on the
link for perl as follows:

cc   array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o eval.o form.o

 malloc.o perl.o regcomp.o regexec.o stab.o str.o toke.o util.o hash.o perly.o u
sersub.o -lc_s -lsocket -lnsl -ldbm -lPW  -lm -lbsd  -o perl
ld: Symbol malloc in /lib/libc_s.a is multiply defined. First defined in malloc.
o
ld: Symbol free in /lib/libc_s.a is multiply defined. First defined in malloc.o
ld: Symbol realloc in /lib/libc_s.a is multiply defined. First defined in malloc
.o

    I went back and reconfigured it to not to use the malloc that comes with
perl and got past that point.  However, when I got down to a2p, I got this:

cc  hash.o  str.o util.o walk.o a2p.o -lc_s -lsocket -lnsl -ldbm -lPW -lm -lbsd
- -lmalloc -o a2p
ld: Symbol errno in /lib/libc.a is multiply defined.
make[1]: *** [a2p] Error 1
make: *** [all] Error 1

    libc is set to /lib/libc_s.a in config.sh both in the main perl directory
and in x2p.  What gives?  I would appreciate any insights...

Cheers--

Al

-- 
Al Gaspar	<gaspar@st-louis-emh2.army.mil>
USAMC SIMA, ATTN:  AMXSI-TTC, 1222 Spruce St., St. Louis, MO  63103-2834
COMMERCIAL:  (314) 331-4354	AUTOVON:  555-4354
relay1.uu.net!st-louis-emh2.army.mil!gaspar
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: Pipe, et al, what am I doing wrong?
Keywords: pipe, fork
Date: 28 Jul 92 17:15:33 GMT
Organization: NetLabs, Inc.

In article <1992Jul27.115715.21337@neptune.inf.ethz.ch> weingart@inf.ethz.ch writes:
: Here is a small script, that seems to hang.  What am I doing
: wrong?  A ps shows that the child is waiting for the parent
: to `wait` on it.  Also, the parent seems to hang because it
: does not get EOF.

Each process needs to close the end of the pipe it's not using.

Larry
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Newsgroups: comp.lang.perl
Subject: Re: Repeat string matching/substituting ?
Date: 24 Jul 92 15:12:15 GMT
Distribution: comp
Organization: Loral Western Development Labs

In article <TSHIELDS.92Jul23160911@woodie.oracle.com> tshields@oracle.com (Thomas A. Shields Jr.) writes:
>I need to surround each occurrence of a string within a line with
>begin and end tags, i.e.  "the place the fox went is the chickencoop"
>with keyword "the" needs to become "<begin>the<end> place
><begin>the<end> fox went is <begin>the<end> chickencoop".
>Here's what I tried:
>#!/usr/bin/perl -p
>while (/the/g) {
>  $_ = $` . "<begin>" . $& . "<end>" . $';
>}
>but this fails unpredictably, probably because //g doesn't like the
>fact that $_ is changing on it.  Any insight into how //g works
>internally, or a better way to accomplish this in general would be
>much appreciated.  Thanks!

Boy that's the hard way.  What's wrong with:

s/the/<begin>the<end>/g;

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
Newsgroups: comp.lang.perl
From: mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner)
Subject: Process question...
Organization: University of North Carolina at Asheville
X-Newsreader: Tin 1.1 PL3
Date: Wed, 22 Jul 1992 23:16:37 GMT

This has stumped me.

I want to fork off a process, but be able to read the forked 
processes' stdout in the parent, as well as feed the forked process
stdin from the parent. Preferably an execed process. :)

________________
| main  ^    V |
________|____|_|
       ?|   ?|         stdin   __________________
        |    |---------------->| forked process |
        |                      -----V------------
        |<--------------------------| stdout

How to do this in perl has baffled me, and I don't see it in the FAQ. 
I suspect there's some kind of file or pipe involved, but beyond that
I'm lost.

Luckily there are people on this newsgroup who've forgotten more about
Perl than I'll ever know!

Maybe an example would help...

fork a process that will exec 'sort'
parent feeds sort a bunch of words, and reads sort's output for use later.

(I know you can sort in perl, it's just an example! :))

or

fork and exec inews
feed it a post
read the output and decide whether to bother a human about it

Scott

Newsgroups: comp.lang.perl