[8364] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1981 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 26 14:14:40 1998

Date: Thu, 26 Feb 98 11:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Feb 1998     Volume: 8 Number: 1981

Today's topics:
    Re: @array troubles <neiled@enteract.com>
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et (Billy Chambless)
    Re: better way to do this? uri@sysarch.com
    Re: better way to do this? (Earl Hood)
    Re: Converting a Perl4 script to Perl5 (I R A Aggie)
        dbm file format? (Kevin B Cohen)
    Re: dbm files <jbc@west.net>
    Re: Getting started with CGI/Perl <jrj120@psu.edu>
        How to pass 2 lists to a subroutine while using strict <enaiman@ndsisrael.com>
    Re: How to pass 2 lists to a subroutine while using str (Earl Hood)
        Install of tk800.000.gz tkperl <sirron@mail.mcoe.k12.ca.us>
    Re: INTERNAL SERVER ERROR - Help??? <jbc@west.net>
    Re: Internationalization <mthurn@irnet.rest.tasc.com>
    Re: Killfile Triage <rone+usenet@ennui.org>
    Re: Newbie question.   Do you recommend moving from C? (Mark Daku)
    Re: Newbie Question: df in a perl script <dboorstein@shopcfn.com>
        print and the trinary ?: <prl2@lehigh.edu>
    Re: proper filename extensions <bcoleman@mindspring.com>
        SybPerl bcp_init <ken.chesak@dhs.state.tx.us>
    Re: system(command) = fork + exec(command)? kill parent <andrew@erlenstar.demon.co.uk>
    Re: system(command) = fork + exec(command)? kill parent (Andrew M. Langmead)
    Re: system(command) = fork + exec(command)? kill parent <JYoungman@vggas.com>
    Re: The Ineffable Tom C. (Sean Ahern)
    Re: The Ineffable Tom C. (Sean Ahern)
    Re: The young man and the beach, part II (Jeffrey R. Drumm)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 26 Feb 1998 12:09:03 -0000
From: "Neil Edmondson" <neiled@enteract.com>
Subject: Re: @array troubles
Message-Id: <6d4beh$pbp@eve.enteract.com>

Look up "split" and use

Mukund Rao wrote in message ...
>Hello. I'm receiving a web-form submission containing multiple words:
>
>$ITEM = $in{'ITEM'};    # $ITEM contains "hello there"
>
>I would like to extract just the 1st word or just the 2nd word, and am
>trying to do so via this method:
>
>@array = $ITEM;
>print $array[1];   # which should print out "there".
>
>However, I am only able to print out contents of $array[0] which contains
>"hello there". Could you please give me some advice as to how to break up
>$ITEM into an array and extract the elements as above. I don't think my
>syntax is working properly.
>
>Thank you -- please address email to me as "mrao@trincoll.edu"
>
>On Wed, 25 Feb 1998, Chipmunk wrote:
>
>: [posted and mailed]
>:
>: Douglas Cordero wrote:
>: >
>: > I came up with this, but it doesn't work:
>:
>: Is this your real code?
>:
>: > foreach $A1 (@array1) {
>:           ^^^
>:
>: >         $found = 0;
>: >         foreach (@prodata) {
>: >                 if (m/$A/) {
>:                         ^^
>:
>: >                         $found = 1;
>: >                         last;
>: >                 }
>: >         }
>: >         if( $found == 0 )
>: >                 { die "MISSING DATA\n" }
>: > }
>:
>: You have two different variables there.  The -w switch would have alerted
you
>: to this.
>:
>: --
>:  _ / '  _      /             rjk@coos.dartmouth.edu
>: ( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
>:     /                                        http://www.ziplink.net/~rjk/
>:         It's funny 'cause it's true ... and vice versa.
>:
>:
>
>




------------------------------

Date: 26 Feb 1998 17:48:42 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <6d49tq$59p$1@nntp.msstate.edu>

In article <6ckees$8n3$1@client2.news.psi.net>, abigail@fnx.com (Abigail) writes:
|>++>(of any repute) and could I suggest that they use the alternate 'RTCM' (Read 
|>++>The Copulating Manual) acronym instead.

|> ++ Why not create a censored version. Something like
 
|> ++ 	RT*M

|> Grow up. This isn't the 50's.

I've never understood the point of replacing a letter in an alleged
obscenity, anyway. If I write "f*ck off and die", it's clear that I
meant "fuck off and die", or there's no point in writing it. So why not
just write the word correctly, instead of replacing it with a lame
regex?

ObAlmostOnTopic: I've used euphemisms in reverse, though -- in one tech
manual, at one point, I suggested that the user Read the Furnished
Manual. This phrase got past the editors, and will suggest to about half
the readers to RTFM. ;)

-- 
* "And there _is_ a real world. In fact, some of you
*    are in it right now."  -- Gene Spafford


------------------------------

Date: 26 Feb 1998 12:59:44 -0500
From: uri@sysarch.com
Subject: Re: better way to do this?
Message-Id: <x7vhu21c33.fsf@sysarch.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, uri@sysarch.com writes:
> :mocat@spamtrap.best.com (jay) writes:
> :use \s* since there could be more than 1 whitespace
> 
> No, use \s+.   I get tired of people getting false positives
> on phone-number detection who look for /\d*-\d*/ and 
> find that Tim Berners-Lee is a phone number.
> 
> --tom
> -- 
> 	Tom Christiansen	tchrist@jhereg.perl.com


boy, this is a thrill! i get to correct tom c.!

the regex needs to match "src=" in an <img>. so \s+ would fail if there
is no space. in this case \s* is correct. he had in his last version \s?
which is fine unless someone wrote the html with multiple spaces

here is the code from mocat@spamtrap.best.com (jay):

        ($alt) = $imgargs =~ /\bsrc\s?=\s?"(.*?)"/i;


tom, it helps to know the context of the original regex. i do know that
\s* can be very bad for your health, i use \s+ most of th time.

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


------------------------------

Date: 26 Feb 1998 18:29:29 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: better way to do this?
Message-Id: <6d4ca9$2ul@news.service.uci.edu>

	[mail and posted]

In article <6d43u6$qpa$2@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, uri@sysarch.com writes:
>:mocat@spamtrap.best.com (jay) writes:
>:use \s* since there could be more than 1 whitespace
>
>No, use \s+.

Then you will miss valid markup.  In HTML (SGML) you can have
zero or more whitepspace around the value indicator (which is '=').
Hence if you use \s+ around =, you would not match:

	<img src="file.gif" alt="Hello">

--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


------------------------------

Date: Thu, 26 Feb 1998 12:26:42 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Converting a Perl4 script to Perl5
Message-Id: <fl_aggie-2602981226420001@aggie.coaps.fsu.edu>

In article <34F5BBBD.5010@frontiernet.net>,
chriss%total_information@mcimail.com wrote:

+ Question 1: Is there any benefit (speed of execution) to changing this
+ to "use CGI.pm;"?

Benefit? yes. CGI.pm is less buggy, IMHO.

+ Question 2: Are there any pitfalls I should be aware of?

Not really.

+ Question 3: It uses &ReadParse(*input) to gather data submitted from an
+ HTML form.  Will I have to basically re-write the entire script to
+ conform to CGI.pm?

Nope. Instead of 'require cgi-lib.pl;', replace that line with 
'use CGI qw(:cgi-lib);', and CGI.pm will emulate cgi-lib.pl.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 26 Feb 1998 13:37:19 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: dbm file format?
Message-Id: <6d4cov$rna@julius.ling.ohio-state.edu>

hi,

having looked in the blue camel, and the blue llama, and sniffed about
in the man pages/faq's, i can't quite figure out how you go about
making the files that get used by the dbmXXX functions.  i read on the
"Perl for Win32" faq's that "DBM files are "binary"", so i don't guess
i'm just going to be creating a couple of text files..... do i need to
write a script to do the initial creation of the files???

kevin



------------------------------

Date: Thu, 26 Feb 1998 09:50:08 -0800
From: John Callender <jbc@west.net>
Subject: Re: dbm files
Message-Id: <34F5AB50.9C2E086C@west.net>

Jeffrey R. Drumm wrote:
> 
> If you already know how to add to or access a record in a dbm file,
> then you
> _should_ understand that dbms are effectively treated as hashes.
> Therefore, you
> would use the same method to delete a record from a dbm as you would a
> hash.
> 
> Go ye forth and read the extremely copious and very well-written
> documentation
> that comes with Perl.  You don't have to read all of it (although most
> folks
> here would love it if you did); there's a function listed in the
> perlfunc man
> page/html document/pod file that does exactly what you want. You've
> already
> used its name in your question. Its entry even mentions dbm files.
> 
> Please do a little homework before posting . . .
 
There's an element of sadism in posting a 20-line response upbraiding
someone for not researching his question properly before posting,
telling him that you know the answer, giving him hints he may or may not
be able to understand, and all the while refusing to give the answer --
which would have required only a single line of about 10 characters.

I know the standard explanation for this, and I actually agree with it
to a point: Better to whet the student's appetite for knowledge and
point them in the right direction, teach a man to fish and you feed him
for a lifetime, etc...

But the fact is that just as it annoys tchrist and his imitators to see
the same dumb questions posted over and over again, it annoys me (and
probably a few others as well) to see six identically worded comebacks
making fun of the questioner (none of which gives the answer the
questioner is obviously seeking). If the "greater good" we're seeking is
to improve the signal-to-noise ratio of the group, I humbly submit that
we'd be better off just answering the damn question.

If you want to teach the person to fish while you're at it, great! But
belittling someone is a pretty lame way to do it. (Actually, this was a
pretty tame example as far as belittling goes. But you know what I
mean.)

Just felt like pulling down the SNR a little more...

--
John Callender
jbc@west.net
http://www.west.net/~jbc/


------------------------------

Date: Sun, 22 Feb 1998 19:23:08 -0500
From: James Juran <jrj120@psu.edu>
To: Thad Rolling <thad@execpc.com>
Subject: Re: Getting started with CGI/Perl
Message-Id: <34F0C16C.18DD9D9F@psu.edu>

[posted & mailed, due to my slow news server]

Thad Rolling wrote:
> 
> Hello,
> 
> I am getting started using Perl scripts via CGI on my web server.  My server
> is RedHat 4.0, Apache and Perl 5.003.  It looks like I am missing a
> configuration somewhere because when I try to run a Perl program through a
> web page, I get a "Server Error".
> 
> Since I am new to Perl and CGI and Apache (but not HTML), I was wondering if
> anyone has a checkoff list of things needed to run Perl CGI programs.  A
> simple working example would be great too!

Go to http://www.perl.com and read the CGI FAQ's, especially the Idiot's
Guide to Solving CGI Problems.  

Followups set to c.l.p.m.

--
James Juran
jrj120@psu.edu


------------------------------

Date: 26 Feb 1998 17:49:40 GMT
From: "enaiman" <enaiman@ndsisrael.com>
Subject: How to pass 2 lists to a subroutine while using strict
Message-Id: <01bd42ee$6692fa80$77140a0a@enaimanlt.ilndc.com>

Can someone please point me to the manual pages that have an example on how
to pass 2 arrays or lists to a subroutine with strict on?

In Perl4, I just used typeglobbing and sent a * in to the subroutine.  I'd
like to keep strict on as much as possible and I can't figure out how to
pass in a reference with strict "vars" on.

Here's my Perl4 code:
------------------------------------------------
local(@foo1, @foo2);
&foo(*foo1, *foo2);

sub foo
{
    local(*bar1, *bar2) = @_;
}
------------------------------------------------
If I want to add: use strict "vars"; to the beginning and change the
local's to my's, is there a way to do it?

Please post (if appropriate) and send email.

In advance, thanx,

-- 
Ephrayim "EJ" Naiman
NDS Technologies Israel Limited
enaiman@ndsisrael.com




------------------------------

Date: 26 Feb 1998 18:48:41 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: How to pass 2 lists to a subroutine while using strict
Message-Id: <6d4de9$3rb@news.service.uci.edu>

	[mail and posted]
In article <01bd42ee$6692fa80$77140a0a@enaimanlt.ilndc.com>,
enaiman <enaiman@ndsisrael.com> wrote:

>In Perl4, I just used typeglobbing and sent a * in to the subroutine.  I'd
>like to keep strict on as much as possible and I can't figure out how to
>pass in a reference with strict "vars" on.
>
>Here's my Perl4 code:
>------------------------------------------------
>local(@foo1, @foo2);
>&foo(*foo1, *foo2);
>
>sub foo
>{
>    local(*bar1, *bar2) = @_;
>}
>------------------------------------------------
>If I want to add: use strict "vars"; to the beginning and change the
>local's to my's, is there a way to do it?

Change foo to use references instead of typeglobs:

my(@foo1, @foo2);
foo(\@foo1, \@foo2);

sub foo {
    my($aref1, $aref2) = @_;
}

You will have to use dereferencing in foo in order to access the
arrays (eg: $aref->[0]).

I believe passing multiple arrays to a routine are covered in the
Camel and FAQ.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


------------------------------

Date: Thu, 26 Feb 1998 09:44:13 -0800
From: Joseph Norris <sirron@mail.mcoe.k12.ca.us>
Subject: Install of tk800.000.gz tkperl
Message-Id: <34F5A9ED.43B83DC4@mail.mcoe.k12.ca.us>

hello group,

After make install completes successfully
I do a make test

I get the following:

/usr/bin/perl -I./blib/arch -I./blib/lib demos/widget
TRANS(SocketUNIXConnect) () can't connect: errno = 111
couldn't connect to display ":0" at blib/lib/Tk/MainWindow.pm line 54.
MainWindow->new() at demos/widget line 21
make: *** [test_dynamic] Error 111

Any ideas about where I am going wrong?

Thanks



------------------------------

Date: Thu, 26 Feb 1998 09:27:09 -0800
From: John Callender <jbc@west.net>
To: Pat Schmitt <pschmitt@astronpub.com>
Subject: Re: INTERNAL SERVER ERROR - Help???
Message-Id: <34F5A5ED.B9A2CF90@west.net>

Pat Schmitt wrote:
> 
> I received an INTERNAL SERVER ERROR while attempting to run the
> following
> script:
> 
> ./cgi-bin/Form_processor/form_processor.cgi.
> 
> I am running Selena Sol's Form Processor.  All permissions and links
> are
> correctly set per installation instructions.  I could use some ideas.
> I am
> stumped.  Any help would be appreciated.

To help you we would need more information. A good starting point would
be:

* what happens when you try to execute the script from the command line,
rather than from a browser?

* what appears in your Web server's error log when you try to invoke the
script from a browser?

As much as it pains me to direct you there, I'm forced to recommend that
you read Tom Christiansen's "Idiot's Guide to Solving Perl CGI
Problems," available (among other places) at:

http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html

(Please don't take offense at Mr. Christiansen's snotty tone. He
actually means well; it's just that his shoes are perpetually a little
too tight, or something.)

If you go through the steps in that document, you might very well be
able to solve the problem on your own. At a minimum you'll have much
more specific information to post here.

Good luck!
--
John Callender
jbc@west.net
http://www.west.net/~jbc/


------------------------------

Date: 26 Feb 1998 12:56:30 -0500
From: Kingpin <mthurn@irnet.rest.tasc.com>
Subject: Re: Internationalization
Message-Id: <eun2feuu5t.fsf@irnet.rest.tasc.com>

schwern@starmedia.net writes:

> 7)  Make as many copies of message.po as you wish to have translations, and
> give a copy to each of your translators...

  ...along with all your meticulously commented source code with
messages in context, a complete set of documentation for your
software, and an 800-number to your engineering team, so the
translators know if "file" is a noun or verb, "open" is a verb or
adjective, etc. etc...

-- 
 - - Martin "Kingpin" Thurn                    mthurn@tasc.com
     Research Software Engineer           (703) 834-5000 x2926
     The Information Refinery              http://tir.tasc.com
     TASC, Inc.                            http://www.tasc.com

I don't know where you get you delusions, laser brain. -- Leia, The Empire Strikes Back


------------------------------

Date: 26 Feb 1998 10:48:24 -0800
From: st. paul's wort <rone+usenet@ennui.org>
Subject: Re: Killfile Triage
Message-Id: <rone.ThuFeb26104646PST1998.11871@ennui.org>

In article <34f3a2b6.925899@news.omen.net.au>,
peter caffin <synic@omen.net.au> wrote:
>I simply do not see what the fuss is about. Sighting nospam_ masks in From:
>headers during a reply is trivial (unless you happen to be writing a spam-bot
>which does your replying for you).

From: <synic@omen.net.au>
From: <synic@omen.net.au>
From: <synic@omen.net.au>

rone
go go gadget spambots!
-- 
The finest day that i ever had
Was when i learned to cry on demand


------------------------------

Date: 26 Feb 1998 12:08:35 -0500
From: daku@nortel.ca (Mark Daku)
Subject: Re: Newbie question.   Do you recommend moving from C?
Message-Id: <esq1zwqway4.fsf@nortel.ca>

Roger Hill <hillr@bellsygma.co.uk> writes:

> > :Case in point perl.  With the upcoming release of perl and it's follow
> > :ups you will see a language that truly is multi platform.  With features
> >
> > What specific features are you thinking of that are in the upcoming release
> > of perl that makes it multi-platform?

No source changes.  The only issues you have to face are services issues.
If a platform does not have a service you can't use it.  This is not the case in
C or C++.  The language variations also have to taken into account.

> > :I must admit I'm looking for the C++ killer.  Java still has the potential.
> > :Perl does too.  Perl is in the lead for me at this point.  But I'm biased
> >
> > I can't imagine a scenario where perl becomes a C++ killer ...

Time to market.  Uniform string manipulation.  NO pointers.  Pointers
are the worst.  References are far better.  Yes they exist in C++ but
does anyone use them.  Not really.  Now that a X lib exists I can
really develop strong applications.  Having the ability to use runtime
evaluation, and dynamic class creation is a definite strength over
C++.  I don't mean prototypes.  I mean I can actually create the code
at run time for a class.  NO Prototyping needed.  Run time extesibilty
that C++ simply can't touch.  Also perls ability to manipulate data
isn't even approached by C++.

Now I find my perl applications also run faster than my C++ apps.  Why
you ask.  Well I always have to reinvent the wheel in C++.  Since I'm
doing everything from scratch I have to cut corners to achieve time
to market.  This impacts the efficiency of my code.

Threads have been a long awaited feature for me.  This is going to be a huge
boom to network applications written in perl.  No more extremely complex
fork and data sharing issues just to achieve a responsive perl server.

> I can only quote my own experience. I have written a perl/tk applet that
> interacts with communications systems over a LAN using Sockets, X.25 etc. It
> was originally written to run under HP-UX. It now works on Linux, Win95, NT
> (and would run on the Mac if perl/Tk existed on the Mac).
> 
> How much code did I have to change to achieve this level or portability?
> 
> Not a single line!

Here Here.

> Now I'll admit that I'm not doing hard stuff like Database access (But even
> there I have another app that uses the sams script between a laptop running
> Linux and mysql and an HP-UX box running Oracle, only the login strings are
> different)

Actually I prefer doing DB stuff in perl.  perl is a data langauge.  C++ is not.
The over head of allocating space and managing that space in C C++ is a killer
and is most often the cause of lost data and mem leaks.  This is not a problem in
perl.

> My experience of perl portability has been very positive.

My experiences in porting have been a none issue.  I just copy the code and
maybe I have to adjust the #! header.  Oh boy that was tough. I like being
able to take my work home and put it on my mac and keep working.  No slow
modem connects trying to do X to my mac.  Just so I can get some work done.

> Roger Hill

Mark Daku


------------------------------

Date: Thu, 26 Feb 1998 11:58:23 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Newbie Question: df in a perl script
Message-Id: <34F59F2F.2064ED29@shopcfn.com>

I have a life, and I can prove it! wrote:
> you can get the output from practically any system command this way:
> @output = print `SYSTEMCOMMAND`;
> 

shouldn't that be:

@output = `SYSTEMCOMMAND`;

otherwise you'll just end up with print's result code in @output.

dan
--
#!/usr/bin/perl -w -- 2 for 1    dan boorstien <dboorstein@shopcfn.com>
# my first Just another Perl hacker,
seek DATA,0,0;{$_=<DATA>,/!/&&redo}print join(' ',(split)[3..6])__END__
# my second Just another Perl hacker,


------------------------------

Date: Thu, 26 Feb 1998 13:02:42 -0500
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: print and the trinary ?:
Message-Id: <6d4ao2$qdk@fidoii.cc.Lehigh.EDU>

I want to say:
print "  action:         ", ($action eq "update") ? "update" : "purge";

but perl chokes on all the "s.  Any ideas how to do this?  I'd hate to use
more than 1 line to do it.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Phil R Lawrence               phone: 610-758-3051
Programmer / Analyst      e-mail: prl2@lehigh.edu
194 Lehigh University Computing Center
E.W. Fairchild - Martindale, Bldg. 8B
Bethlehem, PA  18018
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





------------------------------

Date: Thu, 26 Feb 98 13:33:09 +0400
From: "Ben Coleman" <bcoleman@mindspring.com>
Subject: Re: proper filename extensions
Message-Id: <ruueyxwczjigapc.pminews@user-37kbob2.dialup.mindspring.com>

On Tue, 24 Feb 1998 22:36:34 -0500, Charles E. Burleson wrote:

>Would
>someone please tell me what the proper file extensions are

I know I've seen recommendation to use .plx(PerL eXecutable?) on
platforms that require an extension(rather than an execute bit), and
that's what I use, but I can't find the reference right now(probably
in "Learning Perl on Win32 Systems", the one Perl book I have access
to that isn't at hand at the moment).  The idea is to distinguish
between Perl scripts and Perl 4-style libraries.

Ben
-- 
Ben Coleman NJ8J                     | The attempt to legislatively
Internet: bcoleman@mindspring.com    | micromanage equality results, at
http://bcoleman.home.mindspring.com/ | best, in equal misery for all.





------------------------------

Date: Thu, 26 Feb 1998 11:59:15 -0600
From: Ken Chesak <ken.chesak@dhs.state.tx.us>
Subject: SybPerl bcp_init
Message-Id: <34F5AD73.A6DB8471@dhs.state.tx.us>

I am writing a sybperl program which uses the bcp calls.  The fields
being sent to  bcp are varible length and tab delimited.  How is the
delimiter included in the bcp call.  Code sample follows:

&BCP_SETL($DBTRUE);         # what does this do?
$dbproc = &dblogin($USER, $PASSWD);
&dbuse($dbproc, $DB);

&bcp_init ($dbproc, "mvr.dbo.vehicle", '', 'bcp.err', $DB_IN);
&bcp_meminit ($dbproc, 42); #number of columns

while (<DATA>) {
                $s = &generate_genericstmt ($_);
                @dat = split('\t', $s);
                &bcp_sendrow($dbproc, @dat);
}

Sybase error: For bulk copy, all variable-length data must have either a
length-
prefix or a terminator specified.




------------------------------

Date: 26 Feb 1998 17:01:30 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: system(command) = fork + exec(command)? kill parent, children?
Message-Id: <87afbe2tcl.fsf@erlenstar.demon.co.uk>

>>>>> "Michael" == Michael Wang <mwang@alhena.ibk.ml.com> writes:

 Michael> If system(command) = fork + exec(command),

more precisely,

   system(command) = fork + exec("/bin/sh","sh","-c",command) + waitpid

 Michael> then how can I get the PID of exec(command), not the
 Michael> PID of the system(command) which is the parent of 
 Michael> the "command". 

Um, system() doesn't make the child pid available, because it's
not intended to return until after the child has terminated anyway.

Use fork and exec directly if you need fine control. It isn't hard.

 Michael> This also brings up another question. On unix (solaris)
 Michael> system, what happens to the children if you kill the
 Michael> parent? becomes zombie or killed as well, and what
 Michael> determines what will happen? Thanks. 

The child processes become "orphans"; they are not killed (except in
certain specific circumstances).

-- 
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>


------------------------------

Date: Thu, 26 Feb 1998 17:27:12 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: system(command) = fork + exec(command)? kill parent, children?
Message-Id: <EozxtC.EDK@world.std.com>

mwang@alhena.ibk.ml.com (Michael Wang) writes:

>If system(command) = fork + exec(command),
>then how can I get the PID of exec(command), not the
>PID of the system(command) which is the parent of 
>the "command". 

The real "exec" system call does not change the PID, it overlays the
new program onto the current process. The only problem with perl's
"exec" is that it may spawn a shell if its single argument contains
shell metacharacters. In that case the PID you get is the PID of the
shell, and when the shell does its own fork and exec, the program that
the shell calls gets its own PID.


>This also brings up another question. On unix (solaris)
>system, what happens to the children if you kill the
>parent? becomes zombie or killed as well, and what
>determines what will happen? Thanks. 

As long as the parent is running, they will remain zombies. Once the
parent exits (and in the above case where a shell is calling another
program, the shell will exit fairly soon.) then init will reap them.

-- 
Andrew Langmead


------------------------------

Date: 26 Feb 1998 17:19:52 +0000
From: James Youngman <JYoungman@vggas.com>
Subject: Re: system(command) = fork + exec(command)? kill parent, children?
Message-Id: <u1n2fecmh3.fsf@noisy.vggas.com>

>>>>> "MW" == Michael Wang <mwang@alhena.ibk.ml.com> writes:

  MW> If system(command) = fork + exec(command), then how can I get
  MW> the PID of exec(command), not the PID of the system(command)
  MW> which is the parent of the "command".

I can't think of a good way that doesn't just involve replacing
system("...") with your own equivalent that uses fork() and exec(),
except the special case where the command to be executed can be of the
form

echo $$; exec some-command-name-here some-args-too

  MW> This also brings up another question. On unix (solaris)
  MW> system, what happens to the children if you kill the
  MW> parent? becomes zombie or killed as well, and what
  MW> determines what will happen? Thanks. 

On all variants of Unix, including Solaris, orphaned processed get
adopted by the "init" process.  Why "init"?  Because it is the one
procesds that is absolutely guaranteed to exist, and it always has the
same PID (one).



------------------------------

Date: Thu, 26 Feb 1998 18:49:38 GMT
From: wrdcom@clara.net (Sean Ahern)
Subject: Re: The Ineffable Tom C.
Message-Id: <34f5b6f6.5921096@news.clara.net>

On 25 Feb 1998 22:20:27 GMT, mgjv@comdyn.com.au (Martien Verbruggen)
wrote:

>
>People who know when to use "its" and when to use "it's".
>
>You're trolling. You're killfiled.

	Oh God: kill-filed by someone who thinks that a single
typographic omission denotes one's entire command of the syntax of the
English language.

	My life is at an end.


	And all because I joined in a thread stating that I don't
believe it's necessary to insult people in the process of giving or
denying them information.
	Let a complete absence of anything resembling politeness
prevail, see if I care.  Since, of course, every damn person on this
group who thinks it's forgivable to insult beginners for asking
'obvious' questions has never, ever done the same thing in their past.



	Sean

	It's : shortened form of 'it is'
	Its :  belonging to 'it' 

	

The Once, and Future,
    White Rabbit


------------------------------

Date: Thu, 26 Feb 1998 18:58:06 GMT
From: wrdcom@clara.net (Sean Ahern)
Subject: Re: The Ineffable Tom C.
Message-Id: <34f5b980.6571359@news.clara.net>

On 25 Feb 1998 21:28:44 GMT, billy@cast.msstate.edu (Billy Chambless)
wrote:


>Oh, how witty!! You sure puts him in his place!

	No, no, no, his comment was FAR wittier.  Even if it missed
the point.

>
>I wonder why you didn't have a similar witty comeback for the passge you
>quoted below -- the one that makes your original reference to _Learning
>Perl_ seem a bit silly.
>
>|>  In this case, the footnote reads:
>|> >"(*) Of course, some questions are too silly to answer, especially
>|> >those already answered in the FAQ."

	Because the point was, since it appears to have escaped you,
that this newsgroup is referred to, at least once, in the 'standard'
beginner's book, as a source of assistance.  So why are you so bloody
surprised when it happens?  You never asked a question that had been
asked before?   
	 And whilst it does say 'some questions are too silly to
answer' it does not say 'some questions will get you slagged off by
people who have nothing better to do than decide their validity, and
judge your intellect accordingly'.
	If you think a question is too dumb to answer, don't answer.


		Sean



The Once, and Future,
    White Rabbit


------------------------------

Date: Thu, 26 Feb 1998 14:48:35 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: The young man and the beach, part II
Message-Id: <34f57473.65789410@news.mmc.org>

On 25 Feb 1998 17:57:47 -0800, jbc@west.net (John Callender) wrote:

(126 lines not worth repeating)

If you'd taken only a small percentage of the time needed to write this to
research the "young chemist's" advice over the last _two_years_, you'd have
seen that he recommends they visit the "Azure Pavilion" fewer times than can be
counted on both hands -- and then only after warning them that he's the
"scribe" of some of those "scrolls."

As for profiting from tutoring, perhaps he does. I don't know, since I haven't
seen him solicit any "beach dwellers" in the year I've been wandering the
beach. He recommends that beach dwellers obtain tutoring where appropriate. He
certainly does NOT recommend they come to HIM.

I can't say I've been entirely happy with some of the things the "young
chemist" has said, but he certainly isn't guilty of your accusations. And from
what YOU'VE posted on c.l.p.m. so far, I don't think you're qualified to make
them.

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1981
**************************************

home help back first fref pref prev next nref lref last post