[18349] in Perl-Users-Digest
Perl-Users Digest, Issue: 517 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 17 21:05:33 2001
Date: Sat, 17 Mar 2001 18:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984881106-v10-i517@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 17 Mar 2001 Volume: 10 Number: 517
Today's topics:
Re: -w and use strict; <uri@sysarch.com>
Re: -w and use strict; <godzilla@stomp.stomp.tokyo>
Re: -w and use strict; <uri@sysarch.com>
Re: -w and use strict; <godzilla@stomp.stomp.tokyo>
Re: `pwd` doesn't work on all servers? nobull@mail.com
Re: ANNOUNCE: Math::MatrixReal::Ext1 msouth@fulcrum.org
Re: ANNOUNCE: Math::MatrixReal::Ext1 msouth@fulcrum.org
Re: Can't combine > and $ (Jim Kroger)
Re: Can't combine > and $ (Jim Kroger)
Re: Can't combine > and $ (Jim Kroger)
help on getting a sorted list of total number of occure <sammy@bigpond.net.au>
Re: many "used only once, possible typo" warnings in CG (Malcolm Dew-Jones)
Re: Print to file <godzilla@stomp.stomp.tokyo>
procedures to do euler path and topological sorting in <cyberian_bear@hotmail.com>
Restricting access using passwords <mike@NOSPAMcomputersurgery.com>
Re: Starting a non-terminating program from within a CG <edinburghguy21@yahoo.com>
Thanks (Jim Kroger)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 17 Mar 2001 23:23:01 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: -w and use strict;
Message-Id: <x7g0gc56ay.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
>> How is this (sending the -w warnings to an admin) accomplished?
G> You should not have warning pragma, strict pragma nor other
G> similar developmental pragma, enabled for a final cgi script
G> made available for public use.
stop calling -w a pragma. you don't even understand the meaning of that
word and you abuse it here.
G> Use of those pragma will slow down your script, cause your script
G> to use more memory, both leading to a less than efficient
G> script. Pragma of this type are intended to be used during
G> development; they are tools to put away when your job is
G> finished. No beneficial purpose is served by including those in a
G> final script mounted for general public consumption. Your script,
G> when it hits the public, is well tested and perfected to a
G> realistically high degree in need of no further diagnostics, or
G> should be.
and your scripts are called so often that you micoroptimize? i bet i
could take ANY one of your scripts, rewrite them, run them with strict
and -w and they will run noticeably faster. i have seen such crap code
come from your mouth that you talking about optimization is silly. i
challenged you the other day to explain what O( N ) means. will you even
dare to do that? you can't use the word optimization unless you can
explain that.
G> or those too lazy to perform exhaustive testing to ensure
G> successful operation under realistic conditions, will
G> leave those developmental tools in a final script.
hah. we have seen mack truck sized bugs in your posted code. you never
seem to grasp the OP's problem space and you claim exhaustive testing.
*CHORTLE*
post another of your rusty gems. let this group show you some gaping
holes.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sat, 17 Mar 2001 16:13:12 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: -w and use strict;
Message-Id: <3AB3FD98.F57C5791@stomp.stomp.tokyo>
Uri Guttman wrote:
(others wrote - erroneously deleted by Guttman)
> > Godzilla! wrote:
> > > How is this (sending the -w warnings to an admin) accomplished?
> > You should not have warning pragma, strict pragma nor other
> > similar developmental pragma, enabled for a final cgi script
> > made available for public use.
> stop calling -w a pragma. you don't even understand the meaning
> of that word and you abuse it here.
(snipped)
You need to study Perl more extensively, Uri.
Are you in love with me, Uri? Abigail seems to think
you are in love with me. I believe you are psychotically
obsessed with me.
Which is it, Uri? Love or psychosis?
Godzilla!
------------------------------
Date: Sun, 18 Mar 2001 00:28:35 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: -w and use strict;
Message-Id: <x7d7bf6hu7.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
G> Uri Guttman wrote:
G> (others wrote - erroneously deleted by Guttman)
>> > Godzilla! wrote:
>> > > How is this (sending the -w warnings to an admin) accomplished?
>> > You should not have warning pragma, strict pragma nor other
>> > similar developmental pragma, enabled for a final cgi script
>> > made available for public use.
>> stop calling -w a pragma. you don't even understand the meaning
>> of that word and you abuse it here.
G> (snipped)
G> You need to study Perl more extensively, Uri.
show me anywhere in the docs that calls -w a pragma. quote it if you
can. please!!
G> Are you in love with me, Uri? Abigail seems to think
G> you are in love with me. I believe you are psychotically
G> obsessed with me.
i am in love with perl which you taint with you crappy code and
miscomprehension of questions and your incredible lack of logic.
saying shit like, it works most of the time which is good enough doesn't
cut it in professional environments. that is a major copout which you
use over and over. notice how all the newcomers here immediately figure
you out as a stupid troll. notice how i don't get slammed for my perl
other than by you. yet you always get slammed for you lack of perl. so
go the fuck away. i am not obsessed with you, but rather i dream of you
absence. go make my heart grow fonder by disappearing. you still have
not one supporter here. why hang around? instead stay on your site where
you can be queen of the morons.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sat, 17 Mar 2001 16:40:34 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: -w and use strict;
Message-Id: <3AB40402.698DEADD@stomp.stomp.tokyo>
Uri Guttman wrote:
> Godzilla! wrote:
> > Uri Guttman wrote:
> > > (others wrote - erroneously deleted by Guttman)
> > > > Godzilla! wrote:
> > > > > How is this (sending the -w warnings to an admin) accomplished?
> > > > You should not have warning pragma, strict pragma nor other
> > > > similar developmental pragma, enabled for a final cgi script
> > > > made available for public use.
> > > stop calling -w a pragma. you don't even understand the meaning
> > > of that word and you abuse it here.
> > (snipped)
> > You need to study Perl more extensively, Uri.
> show me anywhere in the docs that calls -w a pragma.
> quote it if you can. please!!
Randal's excellent books, Learning Perl and Programming Perl,
would be a good place to begin improving your Perl Knowledge.
You do pretty good at Perl but still have a bit of learning.
> > Are you in love with me, Uri? Abigail seems to think
> > you are in love with me. I believe you are psychotically
> > obsessed with me.
> i am in love with perl which you taint with you crappy code and
> miscomprehension of questions and your incredible lack of logic.
> saying shit like, it works most of the time which is good enough doesn't
> cut it in professional environments. that is a major copout which you
> use over and over. notice how all the newcomers here immediately figure
> you out as a stupid troll. notice how i don't get slammed for my perl
> other than by you. yet you always get slammed for you lack of perl. so
> go the fuck away. i am not obsessed with you, but rather i dream of you
> absence. go make my heart grow fonder by disappearing. you still have
> not one supporter here. why hang around? instead stay on your site where
> you can be queen of the morons.
* swoons *
He is in love with me!
Godzilla!
------------------------------
Date: 17 Mar 2001 23:10:04 +0000
From: nobull@mail.com
Subject: Re: `pwd` doesn't work on all servers?
Message-Id: <u91yrwf0vn.fsf@wcl-l.bham.ac.uk>
Bart Lateur <bart.lateur@skynet.be> writes:
> nobull@mail.com wrote:
>
> >> The point was that the OP was having problems with `pwd` so switching to
> >> Cwd::cwd won't help.
> >
> >But switching to Cwd::getcwd will.
>
> It doesn't, in my particular case.
In that case, like I said, it's probably impossible. On Unix the only
way you can get the name of the PWD is to follow the chain of '..'
directory entries back up to the root directory. If there is any
directory between the PWD and the root that you are not permitted to
read then you cannot find out the name of you PWD.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Mar 2001 01:08:37 GMT
From: msouth@fulcrum.org
Subject: Re: ANNOUNCE: Math::MatrixReal::Ext1
Message-Id: <9911ql$d95$1@inxs.ncren.net>
In comp.lang.perl.modules Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was sent to
> <msouth@fulcrum.org>],
> who wrote in article <98vu2s$1h2$1@inxs.ncren.net>:
>> (2) Ease of installation.
>>
>> I said that Math::Pari "appears" to be very powerful because I don't
>> yet know what it can do. I tried installing it from a CPAN shell
>> and it failed.
> "Failed" meaning what? There is one test which gives a false negative
> if Term::Gnuplot is not found. Yes, it is enough to fool CPAN. But
> you got a build dir usable with -Mblib, and you can always use 'force
> install'.
Yes, that was where I saw it have a problem.
> It is fixed for some time in my copy, I'm making a new dist now. If
> it goes OK, in 15min I'll put it on
> ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl/modules
>> It appeared to be looking for Term::Gnuplot,
> It does not *need* Term::Gnuplot, but it knows how to use it *if*
> Term::Gnuplot is present.
Yeah, I didn't figure you needed Gnuplot. I just don't usually
install anything that fails its tests. Rather than force it I
usually try to figure out what is wrong and fix that. Working around
a check that is put in by the author just seems like a less than
wise thing to do most of the time.
>> so I tried installing that, and it failed.
> Well, these was unfortunate. Term::Gnuplot was not prepared to yet
> new twists of gd.a, and had a couple of other bugs. The version in my
> FTP directory is fixed, but the PAUSE mirroring of my directory is not
> working for some reason.
Just to be clear, I was only detailing that install process to make the
point that more powerful/versatile/whatever libraries often have a
greater sense of dependencies. You asked "why would you use an
inferior module?" and "less powerful, but easier to install" is a
reason.
>> (3) Rd*p*O Some people prefer all-Perl modules
> Yes, and some people prefer sh one-liners. It is OK as far as it
> works. But as far as I saw, the solution you tried to use *did not*
> work. *This* was why you started patching.
I think it is at least as fair to say that the solution I was successfully
using, which did everything I needed it to do, which I installed without
a hitch, which I could modify to my heart's content without knowing
anything but Perl, could use, in my opinion, a couple of extra methods.
Lo and behold, it's an object oriented module, and all I had to do was
extend it and I could inherit everything else in the original library.
I don't think this is a contest between the two libraries. You wanted
to know why I would want to use it. I didn't write the other library,
I'm not emotionally attached to it. I'm not claiming that it compares
to the 500 functions available through PARI. But I still can see why
someone might want to use it. And whoever that might be might like a
couple of convenience functions.
Do you think adding these functions would be harmful to the community?
Should we be prevented from working on any but the one true library?
Is arguing against this even worth your time, which, when applied to
writing code, contributes so much to the community? I'm not trying
to claim that an all-Perl, matrix-only, smaller library is better
than an interface to PARI. Some people might want to use it, that's
all. And I just want to make it easier for those people. If you
want, I'll create a new library, copy in all the code from MatrixReal
plus my two methods and rename it Math::InferiorMatrix to warn people
off. I just have a couple of functions that might help a coople of
people, and I'd like to share them where the original code is being
shared. Is this a bad?
mike
--
Michael South | http://fulcrum.org
Head Mathophile, | 101 Canyon Run
fulcrum.org | Cary NC 27513 USA
(msouth@fulcrum.org) | (919) 465-9074
------------------------------
Date: 18 Mar 2001 01:31:56 GMT
From: msouth@fulcrum.org
Subject: Re: ANNOUNCE: Math::MatrixReal::Ext1
Message-Id: <99136c$dre$1@inxs.ncren.net>
In comp.lang.perl.modules Jonas Nilsson <jonni@ifm.liu.se> wrote:
>> $ident3x3 =
> Math::MatrixReal::Ext1->new_from_cols([1,0,0],[0,1,0],[0,0,1]);
>> $upper_tri =
> Math::MatrixReal::Ext1->new_from_rows([1,1,1],[0,1,1],[0,0,1]);
> Suggestion: new_from_cols and new_from_rows should also be able to take a
> reference to an array of references to arrays like this:
> @row1=(1,2,3);
> @row2=(3,2,3);
> @row3=(2,2,5);
> $rows=[\@row1,\@row2,\@row4];
> $mymatrix=Math::MatrixReal::Ext1->new_from_cols($rows);
> or
> $mymatrix=Math::MatrixReal::Ext1->new_from_cols( [ [ 23,21,2 ] [ 32,23,2 ]
> [ 32,23,3 ] ] );
(i think you want some commas there, btw)
> This way less data need to be shuffled onto the heap when "matrixcreators"
> are within a sub.
In light of that, wouldn't it be better to always do it that way? Off
the top of my head, I don't see any reason to allow it the way I had
it. Anything that wants to use it the way I had it can just throw a pair of
[] around what they were going to do, right?
Thanks for your input.
mike
--
Michael South | http://fulcrum.org
Head Mathophile, | 101 Canyon Run
fulcrum.org | Cary NC 27513 USA
(msouth@fulcrum.org) | (919) 465-9074
------------------------------
Date: Sat, 17 Mar 2001 19:14:47 -0500
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Re: Can't combine > and $
Message-Id: <minorseventhSPAMBLOCK-1703011914470001@tritone.csbmb.princeton.edu>
In article <170320011958079403%wuerz@yahoo.com>, Mona Wuerz
<wuerz@yahoo.com> wrote:
> In article
> <minorseventhSPAMBLOCK-1703011335420001@tritone.csbmb.princeton.edu>,
> minorseventhSPAMBLOCK@earthlink.net (Jim Kroger) wrote:
>
> > $_ contains a directory name. I tried:
> >
> > open(OUT, >${_}/scripts/make_mask.txt) || die "can not make mask \n ";
>
> If you want to work with $_, then work with $_. What's wrong with
>
> open(OUT, ">$_/scripts/make_mask.txt") || die "can not make mask \n ";
>
> > I need the file to accept input, thus the >. The whole point of the
> > program depends on using the variable, if I can't keep that there there's
> > no point in writing the automation script in the first place.
>
> I doubt that. If $_ causes trouble (not that it does, but
> hypothetically), you could always grab its contents by saying
>
> my $dir = $_;
> open(OUT, ">$dir/scripts/make_mask.txt") || die "can not make mask \n ";
>
> -mona
Thanks Mona. I meant use *some* variable in that spot. You solved my
problem though, I was missing my quotes. Sorry for the dumb mistake.
Thanks everyone else too.
Jim
------------------------------
Date: Sat, 17 Mar 2001 19:16:44 -0500
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Re: Can't combine > and $
Message-Id: <minorseventhSPAMBLOCK-1703011916440001@tritone.csbmb.princeton.edu>
In article <990chj$3qsk7$3@fu-berlin.de>, news@tinita.de wrote:
> hi,
> Jim Kroger <minorseventhSPAMBLOCK@earthlink.net> wrote:
> > Hi, I'm trying to create an output file in a subdirectory.
>
> > $_ contains a directory name. I tried:
>
> > open(OUT, >${_}/scripts/make_mask.txt) || die "can not make mask \n ";
>
> > and got the error in perldebug
>
> > syntax error at myprogram line 85, near ", >"
> > execution of myprogram aborted due to program errors
>
> well, ">" is an operator that compares to values, eg
> print "less" if 42 > $_;
>
> then you are evaluating the
> expression $_ / 'scripts' / 'make_mask' . 'txt'.
> so you are dividing $_ and scripts and make_masktxt.
>
> -w would have prevented that.
>
> put the whole thing in quotes, that should help
>
> perldoc perlsyn
>
> hth,
> tina
Thanks Tina!
Jim
------------------------------
Date: Sat, 17 Mar 2001 19:16:12 -0500
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Re: Can't combine > and $
Message-Id: <minorseventhSPAMBLOCK-1703011916120001@tritone.csbmb.princeton.edu>
In article <E0Ps6.73$ez4.3092@eagle.america.net>, garry@zvolve.com (Garry
Williams) wrote:
> On Sat, 17 Mar 2001 13:35:42 -0500, Jim Kroger
> <minorseventhSPAMBLOCK@earthlink.net> wrote:
>
> >Hi, I'm trying to create an output file in a subdirectory.
> >
> >$_ contains a directory name. I tried:
> >
> >open(OUT, >${_}/scripts/make_mask.txt) || die "can not make mask \n ";
> >
> >and got the error in perldebug
> >
> >syntax error at myprogram line 85, near ", >"
> >execution of myprogram aborted due to program errors
>
>
> Then correct the syntax error. :-)
>
>
> The second argument to open() is an expression. You wanted this
> instead:
>
> open(OUT, ">$_/scripts/make_mask.txt")
> || die "can't open $_/scripts/make_mask.txt: $!\n";
>
> You must enclose a string in double quotes when you want it to be the
> result of concatenations and variable interpolation.
>
> (There's no need for braces around _, since there's no ambiguity due
> to the slash.)
>
> See `Interpolation' in the perlop manual page.
Thanks. I'll look for the perlop man page. I hope it's easier to
understand the most unix man pages :-).
Jim
------------------------------
Date: Sun, 18 Mar 2001 02:04:19 GMT
From: "sam" <sammy@bigpond.net.au>
Subject: help on getting a sorted list of total number of occurences of the same value of a field in a file
Message-Id: <DIUs6.7634$992.45650@news-server.bigpond.net.au>
Appreciate advise on following:
I have a unix file containing ~ 100k lines consisting of 1st field number
string 2nd number string several other fields also.
I want to find the total number of times each first field is the same and
get a total then sort it so I have the most occurences at either top or
bottom of list
for each different occurence and its total.
I could write it in shell but it would be far too slow too much forking.
I'm quite new to perl so I'd appreciate any explanations of syntax but use
alot of standard unix filtering awk sed ...
100k file
45.67.78.90 fred jones 19yrs London England
45.67.78.60 fred jones 19yrs London England
45.67.78.90 fred jones 19yrs London England
45.67.78.80 fred jones 19yrs London England
45.67.78.90 fred jones 19yrs London England
45.67.78.80 fred jones 19yrs London England
...
result I'm looking for is:
45.67.78.90 total 3
45.67.78.80 total 2
45.67.78.60 total 1
Thanks in Advance
Kim
------------------------------
Date: 17 Mar 2001 15:29:10 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: many "used only once, possible typo" warnings in CGI.pm using import_names("UT");
Message-Id: <3ab3f346@news.victoria.tc.ca>
Scott R. Godin (webmaster@webdragon.munge.net) wrote:
: In article <u9k85o4r4a.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:
: | A completely different approach is simply to declare the variables.
: |
: | {
: | package UT;
: | use vars qw( $mod_type $mod_description ); # And so on...
: | }
: Hmm.. overall I'd have to say that other than ditching the import_names
: sub, this would probably be the best approach.
: I already have a use vars in the script with these exact same variables
: (plus a few more), so copying it under the UT package should be a snap.
"use vars" is the way to go. The trick is to put all your global variable
names into a single array, and that way there's only a single variable
name you ever need to remember, every other variable name is checked by
perl.
step 1, in some sort of common init package
# save the variables names
@my_global_variables = qw( $mod_type $mod_description @etc );
step 2, in the various scripts that use the variables
# declare all the variables names, note the syntax is
# slightly different than normal "use var" usage
use vars @my_global_variables ;
--
Want to access the command line of your CGI account? Need to debug your
installed CGI scripts? Transfer and edit files right from your browser?
What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi
------------------------------
Date: Sat, 17 Mar 2001 16:08:07 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Print to file
Message-Id: <3AB3FC67.8070030B@stomp.stomp.tokyo>
Benjamin Sugars wrote:
> Godzilla! wrote:
> > "Randal L. Schwartz" wrote:
(Godzilla! wrote:)
> > > > open(FILELOCK,"> filelock.tmp");
> > > Basic fragile principles, that is.
> > These principles displayed are, as stated, quite
> > basic and, quite sound, well beyond fragile.
(snippage not noted by Sugars - context not retained)
> To the OP stuck trying get some work done and being distracted by Kira's
> raving, you can safely ignore her.
> If you need further proof of her errors -- even disregarding the race
> condition -- consider how her "beyond fragile" solution would behave
> should a process terminate abnormally (eg, SIGTERM) while it holds a lock.
> Hint: filelock.tmp would still exist, so what would happen to the next
> process doing C<-e "filelock.tmp">?
I am not at all surprised a person of your relative programming
skills has not realized how simple is a solution for these
circumstances, a solution I have posted previously and clearly
not understood by you, although so very basic in nature and
presented within this article of mine to which you are responding.
Perhaps you should read for context rather than remove context?
Appropriate behavior would be for you to not post to this
newsgroup until you have developed sufficient skills in
Perl programming enabling you to afford worthwhile articles.
I have yet to read a single person other than myself offer
a viable solution for emulating a file lock for a typical
Win 32 / DOS operating system.
Too tough of a problem for you boys?
Well darn, sure looks like you are off to another
rough online day, Frank.
Godzilla!
--
@ø=(a .. z);@Ø=qw(6 14 3 25 8 11 11 0 17 14 2 10 18);
$§="\n";$ß="\b";undef$©;print$§x($Ø[4]/2);
for($¡=0;$¡<=$Ø[2];$¡++){foreach$¶(@Ø){
$ø[$¶]=~tr/A-Z/a-z/;if(($¡==1)||($¡==$Ø[2]))
{$ø[$¶]=~tr/a-z/A-Z/;}print$ø[$¶];if($¶==0)
{print" ";}if($¶==$Ø[12]){print" !";}&D;}
print$ßx($Ø[4]*2);}print$§x($Ø[10]*2);
sub D{select$©,$©,$©,.25;}exit;
------------------------------
Date: Sat, 17 Mar 2001 20:10:06 -0500
From: "cyberian bear" <cyberian_bear@hotmail.com>
Subject: procedures to do euler path and topological sorting in perl
Message-Id: <aWTs6.81$gB1.350@typhoon.nyu.edu>
can anyone suggest where i can find the modules which would do those two
things.
thanx cb
------------------------------
Date: Sun, 18 Mar 2001 01:26:53 GMT
From: "Mike Scott" <mike@NOSPAMcomputersurgery.com>
Subject: Restricting access using passwords
Message-Id: <x9Us6.5395$e16.2603659@news2.cableinet.net>
How would one go about implementing a username+password login scheme that
allowed subsequent access to specific areas of a web site? I'm thinking of
something like a bulletin board that requires a user to log in before they
can post a message, or access certain forums. How is this state maintained
after the user has had his username+password accredited?
TIA.
Mike.
------------------------------
Date: Sun, 18 Mar 2001 00:40:22 GMT
From: "Jambo" <edinburghguy21@yahoo.com>
Subject: Re: Starting a non-terminating program from within a CGI script (continued)
Message-Id: <WtTs6.5241$e16.2532108@news2.cableinet.net>
okay thanks for the quick response - i will give that a try
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:990pq1$4n6$1@boomer.cs.utexas.edu...
> In article <pDRs6.4706$e16.2330299@news2.cableinet.net>,
> Jambo <edinburghguy21@yahoo.com> wrote:
> >In my Perl CGI script, I have a system() call which runs the shell
script.
> >The shell script in turn runs the java server as a background process,
> >meaning that the shell script does actually complete if run from the unix
> >prompt.
> >
> >When I run this perl CGI script from the Web, everything works OK - the
> >shell script is run and the java program starts running, and keeps
running.
> >The only problem is that on both Netscape and IE, the browser loading bar
> >never completes - it is continually loading the page in other words.
> >
> >Is this because the java program which is run as a background process is
> >still a part of the CGI process? If I press the "Stop" button in IE, the
> >browser stops and everything is perfect again and the java program is
still
> >runnning in the background (what I want to happen)
>
> I assume you're doing this on Unix. (You didn't say.)
>
> My guess is that it's because the web server has connected a pipe to
> the CGI's standard output, and it's reading from that pipe waiting
> for it to close. However, your CGI's child process inherit the
> CGI's standard output and thus the connection to the pipe. Thus,
> until they all close, the web server won't see them as finished.
>
> One solution is to fork(), then do as it says in
> "perldoc -q 'fork a daemon'", then exec() your child process.
>
> - Logan
> --
> whose? my your his her our their _its_
> who's? I'm you're he's she's we're they're _it's_
------------------------------
Date: Sat, 17 Mar 2001 19:50:08 -0500
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Thanks
Message-Id: <minorseventhSPAMBLOCK-1703011950080001@tritone.csbmb.princeton.edu>
I haven't been programming Perl in a while (never was that good). I just
slog through it when I need a new program. Just want to say thanks to
everyone for helping with the questions I've had the last couple days,
this really is a great place.
Jim
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V10 Issue 517
**************************************