[9963] in Perl-Users-Digest
Perl-Users Digest, Issue: 3556 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 26 21:03:07 1998
Date: Wed, 26 Aug 98 18:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 26 Aug 1998 Volume: 8 Number: 3556
Today's topics:
Re: _reverse_ lookahead? (Charles DeRykus)
Re: comp.lang.perl.windows.misc (Craig Berry)
gd.pm <dsutclif@NoSpam.ucsd.edu>
Re: How to match anything but some characters (reg-exp) <support@ichat.com>
I NEED A PASWORD IN CGI!!!! HELP (cRaZy2U)
Re: Max value in an array (Craig Berry)
MIME Type for files with .PL Extensions? <carter@objectshare.com>
Re: Perl compiler <rra@stanford.edu>
Re: Perl compiler (Sam Holden)
Re: Perl compiler (Alastair)
Re: Perl compiler (Nathan V. Patwardhan)
Re: Perl compiler (Craig Berry)
Re: Perl compiler <rra@stanford.edu>
Re: Perl compiler (Craig Berry)
Re: Perl Cookbook, does anyone have it? dturley@pobox.com
Re: problems with checking file just created <rootbeer@teleport.com>
Re: Problems with system call (Craig)
reading specific words from an Mp3 file <mpryor@concentric.net>
Re: text editing in perl <jdw@dev.tivoli.com>
Re: Threading/forking simple(?) programs (Duke)
undump ported to Solaris <esaxe@SDSC.EDU>
Re: WWW POST via Perl <dean2@mail.biol.sc.edu>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Aug 1998 00:01:45 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: _reverse_ lookahead?
Message-Id: <EyBMqx.qy@news.boeing.com>
In article <6s18l2$11vk$1@ausnews.austin.ibm.com>,
Todd "Waxahachiefortudinouslyexportitionismistically" Hartman <thartman@xxxx.xx> wrote:
>Does Perl have a RE feature that does reverse-lookahead (or look-behind)?
>I didn't see any reference to it in ed. 2 of the Camel in the RE extensions
>section (pp. 58-69). Is there a way to accomplish this?
>
>For example, I want to match a string of digits not preceded by
>the character 'a':
>
> 12345 -- matches "12345"
> b12345 -- matches "12345"
> a12345 -- doesn't match
> joe123456 -- matches "123456"
>
>Is there some way to massage the current RE extensions to do this?
>
Actually, you don't need look-behind:
/(?:[^a0-9]|^)(\d+)/g
hth,
--
Charles DeRykus
------------------------------
Date: 27 Aug 1998 00:07:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s27vl$efs$1@marina.cinenet.net>
Dan Nguyen (nguyend7@msu.edu) wrote:
: Win32 people are a little rude when the post. But so are the *nix
: people. The *nix people are rude because some of them are just tired
: of answer the same questions over and over again. That's why the FAQs
: are there.
Can we please drop the arguments from misued categories, please? Try
doing s/Win32/black/g and s/\*nix/asian/g on the above, and see how it
sounds. The OS someone chooses to use is *not* *relevant* to how they
post, or how they use Perl, except (in both cases) in the technical,
what-version/tool-is-being-used sense. Saying "all A are B" is generally
useless; it's either false or a tautology.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Thu, 27 Aug 1998 00:19:24 GMT
From: "Dale Sutcliffe" <dsutclif@NoSpam.ucsd.edu>
Subject: gd.pm
Message-Id: <gC1F1.294$KK4.750719@news.san.rr.com>
I am trying to use gd.pm.
It does not seem to be working?
How is it set up?
Do I simply place the pm file into a specific directory or what?
Thanks
------------------------------
Date: Wed, 26 Aug 1998 18:13:31 -0500
From: John Warner <support@ichat.com>
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <35E4969B.62B59960@ichat.com>
I've actually found the O'Reilly book _Mastering Regular Expressions_ by
Jeffrey Friedl (the owl book) more useful than either the Lama or Camel
books. It deals exclusively with the concept of what exactly is a regular
expression and then launches into the peculiarities of implementations of
regex engines in various languages (including Perl).
Dan Nguyen wrote:
> Hauk Langlo <hauk@forumnett.no> wrote:
> Try reading the man page on regex's call perlre
> and perlfaq6
>
> : If ($somescalar =~ /"anything exept a-z, 0-9, or -"/g){
> : do stuff
> : }
>
> [^a-z0-9\-] //that's all I'm giving you.
>
> : I know that this problem probably is of a basic structure for the
> : experts out there. I really have tried figuring this out by reading the
> : MAN pages and the exellent Lama and Camel books, but as a newbie it has
> : been to no avail. I'm thankfull for any response.
>
> So read them again. They're great reading material.
>
> -dan
> --
> Dan Nguyen | There is only one happiness in
> nguyend7@msu.edu | life, to love and be loved.
> http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: 27 Aug 1998 00:31:07 GMT
From: crazy2u@aol.com (cRaZy2U)
Subject: I NEED A PASWORD IN CGI!!!! HELP
Message-Id: <1998082700310700.UAA21163@ladder01.news.aol.com>
hi I need a pasword protected web page which requires a login and a password if
you know how please e-mail me at crazy2u@erols.com
------------------------------
Date: 27 Aug 1998 00:43:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Max value in an array
Message-Id: <6s2a40$efs$4@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: ++ no hint of building and throwing away a list of results (even if the ()
: ++ makes sure the list never grows, of course).
:
: Oh, I see. Throwing away a list of zero elements is bad, but you don't
: care about the results of all the assignments?
Not sure what you mean, here. Both our versions have one comparison for
each array element after the first, and one assignment for each true
comparison. The only difference is the syntactic and (possibly) runtime
overhead of (avoiding) building the map results list.
: Or do you honestly believe "$foo = $bar" doesn't have a result?
It does have a result, the lvalue $foo, most often thrown away and
irrelevant to either of our versions -- other than that your version needs
to do the () second statement to avoid returning it (converted to an
rvalue) into the map results list.
: ++ I find that any time you find yourself doing map in a void context, you
: ++ should instead use foreach. There may be some case where this is
: ++ inappropriate, but if so, I haven't encountered it yet. :)
:
: I use map {} where map {} is more intuitive.
This is obviously a matter of taste, but can you describe more clearly how
map is more intuitive than foreach, in this instance or in general? I
find that having to think about using the () trick to avoid building a
results list argues against this idea. Leave that aside, and the two are
basically rearranged versions of each other:
map { op($_) } @arr;
foreach (@arr) { op($_) }
...other than the unneeded return list from map, of course.
: If I'd wanted to restrict myself, I wouldn't use any of map, for, while, if
: or even subroutines. goto is all you need.
Has somebody been pouring rhetoric-inducing drugs into the clpm water
supply the last couple of days? :)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 26 Aug 1998 17:08:45 -0700
From: "Carter Blitch" <carter@objectshare.com>
Subject: MIME Type for files with .PL Extensions?
Message-Id: <6s27ra$48k@sunnyvale.parcplace.com>
Can somebody tell me the MIME Type associated with files with .pl
extensions???
thanks!!!!!!!!!
------------------------------
Date: 26 Aug 1998 16:32:13 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl compiler
Message-Id: <m3lnobwc8y.fsf@windlord.Stanford.EDU>
In comp.lang.perl.misc, Nathan V Patwardhan <nvp@shore.net> writes:
> Yes, but let's not bullshit. It's plain dumb to hardcode passwords for
> many reasons.
While I generally agree with this, it's also the case that sooner or later
you'll have to do that or the equivalent, just because sooner or later
you'll need to deal with a password-authenticated system on an automated
basis.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 26 Aug 1998 23:48:07 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl compiler
Message-Id: <slrn6u97lm.1ap.sholden@pgrad.cs.usyd.edu.au>
On 26 Aug 1998 21:02:21 GMT, Craig Berry <cberry@cinenet.net> wrote:
>Greg Bacon (gbacon@cs.uah.edu) wrote:
>: In article <6s1dlu$9pm$1@marina.cinenet.net>,
>: cberry@cinenet.net (Craig Berry) writes:
>: : So again, just to clarify your position,
>:
>: Careful. Those words (or words similar) are often a segway to a
>: doomed straw man.
>
>Often so. :) In this instance, though, I was merely attempting to pin
>down what Tom's actual views are. I keep getting odd mixed signals on
>that, and would like to disambiguate things a bit so that this argument
>might generate more light and less heat.
>
>: : would it be fair to characterize
>: : your views as any of the following? Choose all that apply:
>: :
>: : a) All software, under all circumstances, should be distributed free-
>: : in-the-GNU-sense.
>:
>: How long have you been reading this group? Were you not around when
>: Tom lambasted the GPL for its viral qualities?
>
>I was indeed. The GPL is a specific instance of the broader category
>implied by free-itGs. I interpret the term to mean software that is both
>monetarily free and modifiable by anyone for their own purposes. However,
>I am rather curious about how Tom C reconciles his position on GPL with
>his views stated in this thread (really curious, that is; no hidden
>agenda, just lack of understanding about his position).
I'm not Tom C obviously but I can offer my views just because I can, of course
you can equally choose not to read...
I believe that software should come in source form. I don't believe that every
piece of software written should be 'free' in the cost nothing sense and the
freely-redistributable sense - although software that is is nice.
If I pay money for software then I want to get the source as well. I expect that
source will be licensed just as the product is licensed so I can't legally give
it away or redistribute it, or use chunks of it in my code, etc, etc. I would
expect to able to modify the source for my use only even if I have to send
those changes back to the place I bought the software from.
Having source means that when I have a critical job to get done by tomorrow
morning and it's 10:30pm on Sunday night and the software is doing something
screwy I have a much greater chance of finding a quick work around, then if
I don't have source.
It means I have a much better chance of writing parsers for the output of the
software, since I can check the source and find those obscure extra bits of
output that happen in strange cases I could never have tested. (This I have
had experience with, both with and without source.)
It means I can fix those bugs that only seem to occur at my site with our
setup, that no one else can seem to duplicate - and feed those fixes back so
that others benefit.
If the source code does something truly remarkable then the company or author
should patent it rather than keeping it a trade secret, since then they can
distribute source with their products.
As for the GPL I don't like it much at all... The Perl Artistic License is so
much nicer...
Sam
------------------------------
Date: Wed, 26 Aug 1998 23:58:20 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Perl compiler
Message-Id: <slrn6u9buu.4i.alastair@calliope.demon.co.uk>
Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>
>I'm not Tom C obviously but I can offer my views just because I can, of course
>you can equally choose not to read...
>
>I believe that software should come in source form. I don't believe that every
>piece of software written should be 'free' in the cost nothing sense and the
>freely-redistributable sense - although software that is is nice.
>
> [SNIP]
Well put! You have perfectly encapsulated a wonderful philosophy.
Thanks,
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 27 Aug 1998 00:27:31 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compiler
Message-Id: <TJ1F1.79$wf3.656465@shore>
Russ Allbery (rra@stanford.edu) wrote:
: While I generally agree with this, it's also the case that sooner or later
: you'll have to do that or the equivalent, just because sooner or later
: you'll need to deal with a password-authenticated system on an automated
: basis.
Using the terms password-authenticated and automated in the same
sentence concerns me.
Could you give a non-web example?
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: 27 Aug 1998 00:20:20 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl compiler
Message-Id: <6s28o4$efs$2@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: Bruce Barnett (see.my.address.below@domain.com) wrote on MDCCCXXI
: September MCMXCIII in <URL: news:yek7lzvsnr4.fsf@grymoire.birch>:
: ++ Suppose some company invested $250,000 in a project written in
: ++ PERL. Suppose patents were pending on the concepts. Suppose those
: ++ that funded it wanted to get compensated for it?
:
: *Bzzzzzt* Wrong answer. You cannot get a patent if you keep it a secret.
: One of the requirements for getting a patent is the publish the invention.
OK, trivial rewrite: suppose those who funded the project wish to keep it
as a trade secret.
: ++ > Just give it away, Lily, and become famous if it's a wonderful program.
: ++
: ++ Suppose it is not Lily's to give away, but instead belongs to the
: ++ people who funded it.
:
: The people who decided to write it in Perl should have thought about
: this question before.
Oh, now, come on. As others have pointed out, the difference in security
between scripts and compiled programs is one of degree, not kind. And
people have just as much legal IP control over either. Spreading FUD like
this does Perl and its community a disservice.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 26 Aug 1998 17:34:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl compiler
Message-Id: <m3pvdnuurx.fsf@windlord.Stanford.EDU>
Nathan V Patwardhan <nvp@shore.net> writes:
> Using the terms password-authenticated and automated in the same
> sentence concerns me.
> Could you give a non-web example?
Sure. Downloading the latest operating system patches from a vendor on an
automated basis from their authenticated ftp server using the support
contract username and password. Authenticating to AFS for the purposes of
archiving copies of my news server logs (in that case, I'm using a
Kerberos srvtab in a file, but that's basically just a password in a file
and has all of the same issues as a password in a script). Creating new
accounts in a Kerberos cell via an automated database process that doesn't
require a human sitting there authenticating each creation, which requires
the cell admin password.
There are a whole bunch, particularly when you get into major-league
authentication systems. Most of the time, those authentication systems
also provide some standard method of putting a password in a file and
authenticating using it (a k4 srvtab or k5 keytab, for example). But it's
still fundamentally a password.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 27 Aug 1998 00:32:16 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl compiler
Message-Id: <6s29eg$efs$3@marina.cinenet.net>
Alastair (alastair@calliope.demon.co.uk) wrote:
: Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
: >I'm not Tom C obviously but I can offer my views just because I can, of course
: >you can equally choose not to read...
: >
: >I believe that software should come in source form. I don't believe that every
: >piece of software written should be 'free' in the cost nothing sense and the
: >freely-redistributable sense - although software that is is nice.
: >
: > [SNIP]
:
: Well put! You have perfectly encapsulated a wonderful philosophy.
He did indeed, and it's a philosophy I also admire. Now, however, back to
the question driving my questioning: Is it, as Tom C _seems_ to believe
(still waiting for his clarification), morally wrong -- 'evil,' to use his
word -- to distribute software without the source?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Thu, 27 Aug 1998 00:38:26 GMT
From: dturley@pobox.com
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6s29q2$mag$1@nnrp1.dejanews.com>
In article <6s1mps$tad$1@nnrp1.dejanews.> I "don't need no stinking review"
... I *know* it will be good. I don't think
> Tom C. is capable, morally, of putting his name on anything that isn't first
> rate.
>
> Patrick Timmins
> U. Nebraska Medical Center
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
Ordered mine two weeks ago from amazon, it's not there yet either. :-(
I've already made use of 3 of the examples from the web page in a project I'm
working on. This book will be great!
David
checking my amazon order status twice a day!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 26 Aug 1998 23:37:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: problems with checking file just created
Message-Id: <Pine.GSO.4.02A.9808261633230.4382-100000@user2.teleport.com>
On Wed, 26 Aug 1998, Arvind Karandikar - VT ~ wrote:
> this works fine, just as it's supposed to. the difference between this
> and what i posted is that the data is coming over a socket instead of
> being read from another file.
Odd, the source of the data shouldn't matter. Can you make a small test
program which does show the bug? Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Aug 1998 00:26:06 GMT
From: craigs@3rdstone.net (Craig)
Subject: Re: Problems with system call
Message-Id: <35e4a72f.102547655@news.vpinet.net>
On Wed, 26 Aug 1998 15:36:16 -0400, Brian Miller
<bmiller@newbridge.com> wrote:
>Hello All,
>
>I am trying to execute a program in the background (graphical
>application) using the system
>call, however the application crashes. I believe the problem has
>something to do with
>connections to IO but I am not sure of the details or how to fix it. If
>I do not use the &
>in the command it works fine, however I want the perl program to move on
>to other things.
>Any suggestions?
>
>Example case:
>
>#!/opt/perl/bin/perl
>
>require 5.002;
>use strict;
>
>my $cmd = 'ksh -c "vsim " & ';
>system($cmd);
Not really sure what ksh is but how about
my $cmd = 'ksh -c vsim';
>
>Thanks
>Brian
>
>--
>
>_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
>bmiller@newbridge.com Newbridge Networks Corporation
>Brian E. Miller 600 March Road, Kanata, Ontario K2K 2E6
>CAE ASIC Process Support (613) 591-3600 ext. 6116 FAX: 599-3654
>
>
>
------------------------------
Date: 26 Aug 1998 17:26:53 PDT
From: "ErLanGen" <mpryor@concentric.net>
Subject: reading specific words from an Mp3 file
Message-Id: <01bdd151$0a1beb80$ccf0adce@gateway--g5-200>
Hi all,
Im using Perl 5.003_07, Perl for Win32 build 316 .
I was given the bit stucture of the frame header in an
Mp3 file. I want to read the first 32 bit word and
also the last 8 words in a file so that I can get the Tag.
Using sysread i think i can get the first word, but i have no
idea how to get the last 8 words.
I think i need my hand held on this script. Has
anyone already written it? These are steps needed to compute
length of time for an Mp3 song.
If you want the bit structure of the frame header
e-mail me back with * Frame Header Bits * someewhere in
the body of the letter.
Cheers,
--
ErLanGen
mpryor@nospam.sprintmail.com
Where do you want to go today?
Come back without crashing or catching a Virus!
------------------------------
Date: 26 Aug 1998 15:56:58 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: text editing in perl
Message-Id: <obiujfbgx1.fsf@alder.dev.tivoli.com>
jasjeet14@my-dejanews.com writes:
> I have simple text file, which is totally jumbled up, with lot of spaces. I
> want to arrange the file in a proper ',' delimited file, with no spaces. The
> point is how to edit this file and remove the extra spaces and arrange it in
> a delimited format ?. Can you tell me how to write a small program in perl
> which can read and thus edit this file into a proper format. The file is
> arranged like this :-
>
> MAJID HUSS=
> AIN 125 (PB) 75 D.K. PUBLISHERS DISTRIBUTORS (P) LTD. G=
> EOGRAPHY AN AGRICULTURAL VIEW OF HARYANA =
> =
> M S KAIRON 95D.K. PUBLISH=
> ERS DISTRIBUTORS (P) LTD. GEOGRAPHY THE =
> ANCIENT GEOGRAPHY OF INDIA
This example isn't really enough information to give a good solution.
You really don't want all spaces turned into commas, (at least I'm
guessing that you don't want AN AGRICULTURAL VIEW OF HARYANA, changed
to AN,AGRICULTURAL,VIEW,OF,HARYANA.
I'm going to take a wild guess that you have a database somewhere that
is spitting out space padded files, and you want your perl script to
spit out comma delimited files.
If that's the case, you really want to look at:
perldoc -f pack
perldoc -f unpack
unpack lets you transform a block like this into an array. Consider the
following:
# assume a table with 3 columns, sizes 16, 24, and 8
$dbase_row = "My width is 16 Mine is 24 only 8 ";
# to get the values out:
@col_vals = unpack("A16A24A8",$dbase_row);
# now print out with commas
print join(',',@col_vals),"\n";
(note you can get rid of the @col_vals, by combining the two lines,
but then where would my comments go... :)
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Wed, 26 Aug 1998 23:22:18 GMT
From: duke@co.kittitas.wa.us (Duke)
Subject: Re: Threading/forking simple(?) programs
Message-Id: <35e4989f.107128552@mars.co.kittitas.wa.us>
Well, I got it working great! except....
Sometimes it seems that bar(1) takes longer than foo(2) and my
blocking doesn't seem to take that into account. My head is hurting
thinking about multithreading, how many seconds are in eternity, and
the paradoxes of time travel. Can you please help one more time (TM &
copyright) on the fork blocking? If I block on waitpid($$) also then
won't I just hang forever since the original PID won't be done?
Thanks again for the help so far,
duke
On 25 Aug 1998 00:58:04 GMT, Zenin <zenin@bawdycaste.org> wrote:
>Duke <duke@co.kittitas.wa.us> wrote:
> >snip<
>> So, how do I implement your answer?
>
> Hmm, maybe something like:
>
> ## Build first set of data for first bar() to work on
> my $iteration = shift @iteration;
> foo ($iteration); ## Blocks until done.
> ...your rename file code here...
>
> foreach my $iteration (@iteration) {
> ## Standard fork() code
> my $pid = fork();
> defined $pid or die "fork(): $!";
>
> ## These run at the same time. The bar() processes the
> ## data from the *last* foo(), not this foo(). In the
> ## first iteration, this would be from the foo() before
> ## the foreach() loop.
> if ($pid) {
> ## Parent
> bar();
> }
> else {
> ## Child
> exit foo(); ## To run $iteration foo's data
> ## Exit value the return value of foo(). Remember, 0 is
> ## "good" and > 0 is "bad".
> }
>
> ## Sync everything
> waitpid ($pid, 0); ## Block until foo() is done
> die "Child error: $?" if $?;
> ...your rename file code here...
> }
>
> bar(); ## To process last iteration of foo's data
>
> __END__
>
> In effect, if we have to do this 5 times we get:
>
> run Foo1
> run Bar1 and Foo2
> run Bar2 and Foo3
> run Bar3 and Foo4
> run Bar4 and Foo5
> run Bar5
>
> So, at any point in time you're running at most two processes, but
> the first and last iteration are special cased as the first Bar
> can't start until the first Foo is done, and this ends up offsetting
> the entire loop so that the Bar to handle the last Foo gets run
> on its own.
>
> Like I said, if Foo was a filter this would be *so* much easier...
> :-/
>--
>-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
>BSD: A psychoactive drug, popular in the 80s, probably developed at UC
>Berkeley or thereabouts. Similar in many ways to the prescription-only
>medication called "System V", but infinitely more useful. (Or, at least,
>more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Tue, 25 Aug 1998 15:22:12 -0700
From: eric saxe <esaxe@SDSC.EDU>
Subject: undump ported to Solaris
Message-Id: <Pine.GSO.4.02.9808251515320.12892-100000@eclipse.sdsc.edu>
I was wondering if anyone has had luck in finding (or porting) a version
of "undump" for SunOS 2.5/Solaris platform.
Most of the versions i've come across seem to be for BSD platforms, or are
so old such that I can't compile them.
It sure would be nice to have a working version (our TeX distribution
didn't have one) in my Perl toolbox.
Thanks
Eric Saxe
Unix Systems Support
San Diego Supercomputer Center
------------------------------
Date: 26 Aug 1998 19:39:22 -0400
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
Subject: Re: WWW POST via Perl
Message-Id: <m3vhnf1ff9.fsf@mail.biol.sc.edu>
"Wim Lambrechts" <Wim.Lambrechts@village.uunet.nospam.be> writes:
> Being a newbie, I would like to be able to write a small routine, that
> connects
> to a specified URL, passes parameters (using the POST-method) and sets some
> parameters
> (webbrowser and reference-page).
> I would like to test this small application under Windows 95 and put it
> later
> onto a Unix server (Perl 5.003).
> I know there is libwww (someone told me in perl.modules - thanks !),
> but it's a bit to complex for me to install it (does it work both
> under Windows 95 and Unix, I can't find a socket.ph on my Windows 95, ... ?)
> Is there a SIMPLE routine available or is there an explanation for newbies
> on libwww
> available ?
Umm... let me get this straight: rather than using code that was
carefully designed and written, and has been tested by thousands of
users, you'd prefer to figure out how to do it all over again, hoping
that you can do it more simply than was done in the provided module
code? Possible. Not likely.
Get and install the "Standard" perl for Win32. You may also find this
listed as the "Sarathy" Win32 port (this is NOT the Active State
port). The current version, at least, comes with the LWP modules
prebuilt. I don't think you'll get much simpler (or much more likely
to work) than using the LWP modules for WWW access.
> If possible, also send an answer to wim.lambrechts.sms@no-spam.usa.net (and
> remove no-spam)
No, I consider it your responsibility to filter spam; it is not my
responsibility to subvert standard Internet reply protocols to do so
for you.
But, sincerely, best of luck with the LWP modules: they really are a
joy to use!
-Dean
--
N. Dean Pentcheff <pentcheff@acm.org>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3556
**************************************