[8241] in Perl-Users-Digest
Perl-Users Digest, Issue: 1858 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 11:15:50 1998
Date: Wed, 11 Feb 98 08:00:32 -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 Wed, 11 Feb 1998 Volume: 8 Number: 1858
Today's topics:
Re: *Web PERL Function Ref.* lvirden@cas.org
base64 -> GIF image ?? <tkowall@edicom.ch>
Re: base64 -> GIF image ?? <xxTony.Curtis@vcpc.univie.ac.at>
Re: Code Example Needed <qdtcall@esb.ericsson.se>
Re: Code Example Needed <tchrist@mox.perl.com>
Re: Code Example Needed (Eileen Kortright)
Comparing timelocal() and parse_dir() <Matthew.Couchman@bbsrc.ac.uk>
Re: getting rid of duplicate lines in a file (M.J.T. Guy)
Re: global pattern match <tchrist@mox.perl.com>
Re: Happy with Perl? lvirden@cas.org
Re: Happy with Perl? <jdporter@min.net>
Re: Happy with Perl? <jdporter@min.net>
Help!! pattern matching <hvanlint@lodestar.be>
Re: Help (Francois Trousset)
Re: how do I mail results in perl? <Dave.Cross@gb.swissbank.com>
keyboard input in BLIND MODE <pascal_amram@ml.com>
Re: Learning Perl (Marek Rouchal)
Re: Learning Perl <Dave.Cross@gb.swissbank.com>
Re: Matt's Script Archive (I R A Aggie)
My Module: To release or not to release... (Steve McNabb)
Re: Perl HTML output in Win 95 (Ronald L. Parker)
Running Perl via Shell vs CGI (Mike Artobello)
syntax error (G Braden)
Re: To All Perl Guru's (I R A Aggie)
Re: Web page does not display all output of cgi !!!!! <barnett@houston.Geco-Prakla.slb.com>
Re: Year 2000 Compliance: Lawyers, Liars, and Perl <dballing@speedchoice.com>
Re: Year 2000 Compliance: Lawyers, Liars, and Perl (John Moreno)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Feb 1998 15:14:26 GMT
From: lvirden@cas.org
Subject: Re: *Web PERL Function Ref.*
Message-Id: <6bsf8i$tf$2@srv38s4u.cas.org>
Try <URL:http://cpan.perl.org/doc/> for lots of online info, as well
as downloadable files of various formats. I am not sure where to
point you, but the core's documentation is available in PDF format
as well.
--
Larry W. Virden <URL:mailto:lvirden@cas.org> ICQ: 5744965
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Wed, 11 Feb 1998 15:52:24 +0100
From: Thomas Kowall <tkowall@edicom.ch>
Subject: base64 -> GIF image ??
Message-Id: <34E1BB28.5C2B@edicom.ch>
Hi,
is there anyone out there who knows how to reconstruct in PERL
a GIF image from its base64 encoded file ?
Any help is highly appreciated.
Thomas
tkowall@edicom.ch
------------------------------
Date: 11 Feb 1998 15:57:42 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: tkowall@edicom.ch
Subject: Re: base64 -> GIF image ??
Message-Id: <7xiuqmgpeh.fsf@beavis.vcpc.univie.ac.at>
Re: base64 -> GIF image ??, Thomas <tkowall@edicom.ch> said:
Thomas> Hi, is there anyone out there who knows how to
Thomas> reconstruct in PERL a GIF image from its base64
Thomas> encoded file ?
module MIME::Base64
hth
tony
------------------------------
Date: 11 Feb 1998 15:16:49 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Code Example Needed
Message-Id: <issopqteem.fsf@godzilla.kiere.ericsson.se>
mystra@torilmud.com (Eileen Kortright) writes:
> -- 1) Yes, I've read the FAQ.
But you obviously missed the recurrent posting about chosing a
relevant subject line.
> What I would like is if someone had a snippet of code that has done
> something like this that would be good for me to learn from?
The date calculation modules you can find on CPAN does something like
that. Even if you don't want to use them you can still look at the
code and see how it works.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: 11 Feb 1998 14:29:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Code Example Needed
Message-Id: <6bsck2$p7v$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, mystra@torilmud.com (Eileen Kortright) writes:
:So far so good. I have the Julian date. Now, I can think of a zillion
:ways to calculate my calendar, but I want to figure out the *best* way
:and the neatest way.
I'm afraid that you haven't given a clear enough question there for
me to understand what you mean. I suspect that you need to think more
about the problem first. Are you trying to figure out the appropriate
data structure? What should it contain? How should it be accessed?
Without well thought-out data structures and access methods, programs are
virtually impossible. With them, they are easy. A venerable textbook
that goes by the title "Algorithms + Data Structures = Programs" extolls
this point quite well. Perhaps you should get it.
Now, how do you go about choosing the proper Perl data structure?
Here's a tip for you:
You're thinking Use
------------------------------------------- -----
anything ordered, like vector, array, list, tuple => @ARRAY
unordered relation, set, bag, record, structure, table => %HASH
When you have a complex relation, such as a lookup table of lists of
records, you need to think about which of the two fundamental data
structures to use at each different level. I suspect that what you
need to do here is maintain a homogeneous data structure, probably a
hash of arrays. You would index this hash using the date, and that
would produce an ordered list of events. If that's what you're going
to be using, you should make yourself comfortable with accessing this
structure: reading it, searching in it, sorting it, writing it out,
selecting only those elements a particular criterion, etc. Examples of
this can be found in the perldsc manpage, or chapter 4 of the caerulean
Camel (blue book edition :-).
The remainder of your message I shall address under separate cover.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
If you consistently take an antagonistic approach, however, people are
going to start thinking you're from New York. :-)
--Larry Wall to Dan Bernstein in <10187@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Wed, 11 Feb 1998 14:46:37 GMT
From: mystra@torilmud.com (Eileen Kortright)
Subject: Re: Code Example Needed
Message-Id: <34e1b633.217265825@news.mw.mediaone.net>
On 11 Feb 1998 15:16:49 +0100, Calle Dybedahl
<qdtcall@esb.ericsson.se> wrote:
>But you obviously missed the recurrent posting about chosing a
>relevant subject line.
Well, obviously I did, since it wasn't included in the messages I
read. I retrieved everything that was currently available on my
newserver and read it all because I do not like to post in a newsgroup
without knowing the "rules". Aside from that, I don't really see what
is wrong with my subject line? I want a code example, that's what my
subject was. How is that irrelevant?
Listen, if all you are going to do is nitpick and slam my post, don't
reply, okay? My gosh you people can be rude.
>The date calculation modules you can find on CPAN does something like
>that. Even if you don't want to use them you can still look at the
>code and see how it works.
I guess that's my bad. I downloaded the perl time-module but didn't
install it because I figured it would get the base for its equations
OS system time -- which already includes the day, month and year.
Doesn't it? Every other piece of code I looked at did.
------------------------------
Date: Wed, 11 Feb 1998 11:43:03 +0000
From: Matt Couchman <Matthew.Couchman@bbsrc.ac.uk>
Subject: Comparing timelocal() and parse_dir()
Message-Id: <34E18EC7.41C6@bbsrc.ac.uk>
Hello,
I'm trying to compare the value from Time::Local's timelocal() and the
$mtime value returned from File::Listing's parse_dir() with some
unexpected results. Are they compatible? I know that the $mtime value is
the no. of seconds since Jan 1, 1970 but the documentation for
timelocal() doesn't precisely what the returned integer represents. Has
anyone else tried this?
Thanks in advance,
Matt.
------------------------------
Date: 11 Feb 1998 14:59:09 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: getting rid of duplicate lines in a file
Message-Id: <6bsebt$fet$1@lyra.csx.cam.ac.uk>
Chipmunk <rjk@coos.dartmouth.edu> wrote:
>
>You could use others' suggestion of a hash, but if you really want the
>equivalent of `uniq`:
>
>perl -ni -e 'BEGIN{$_=""} print unless $_ eq $prev; $prev = $_;' filename
What's that BEGIN{$_=""} meant to be doing? Did you mean BEGIN{$prev=""} ?
Tho' it's not needed anyway, since you're not using -w.
>[you don't need to use cat with that]
Nor did the Unix original - classic example of Useless use of cat.
Mike Guy
------------------------------
Date: 11 Feb 1998 13:55:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: global pattern match
Message-Id: <6bsakj$l5o$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Hans Van Lint" <hvanlint@lodestar.be> writes:
:I want to know if a certain string exists in another, so, I use the
:following line to do so:
:
:(my string is $fnaambedrijf.$fomschrbedrijf, and my searchargument is
:$input{'ubedrijf'})
:
: if ($fnaambedrijf.$fomschrbedrijf =~ /$input{'ubedrijf'}/gi) { $count++; }
:
:What I don't understand is, it always increases $count, even when the
:searchstring doesn't exist in my original string.
Be apprised that $a.$b is the same as join('', $a, $b)
and nearly always also the same as "$a$b"?
Are you sure that your input contains no regular expression
characters?
Have you ever considered the cost of regex interpolation in string?
Finally, the typical "count occurrences" code looks like
while ($string =~ /pattern/g) {
$count++;
}
You had just an if, not a while, which might be useful in some
cases, but I doubt whether it's here.
You'd be amazed at what you can learn by reading
% man perlre
% man perlop
% man perlfaq6
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"No, I'm not going to explain it. If you can't figure it out,
you didn't want to know anyway..." --Larry Wall
------------------------------
Date: 11 Feb 1998 15:05:29 GMT
From: lvirden@cas.org
Subject: Re: Happy with Perl?
Message-Id: <6bsenp$tf$1@srv38s4u.cas.org>
According to Mark Lewis <markl@blinx.lizard.org>:
:is perl stable? would it be a good idea to risk millions of pounds on
:something that is unsupported? what do you think?
What do you mean by stable? Do you mean, does it core dump? It does
for me on occasion - in fact, more frequently than my C compiler or
ksh shell interpreter crashes. Do you mean, does the language change? Yes,
more frequently than the C that my C compiler or my ksh shell interpreter
does. Do you mean do programs written in perl typically get the job done?
Yes, and in fact they probably get going faster than ones being written
in C or ksh shell do...
Would it be a good idea to risk millions? Whose millions? What are
the risks you see? That something goes wrong and you can't get an answer
in a rapid fashion? If there are specific requirements for resolving problems,
then consider what you do for other development languages. Typically,
a company investing millions ensures they have hired someone
competent in resolving problems in a timely fashion. I would recommend
the same practice for perl as would be done for any language.
However, note that it will be _easier_ for someone to resolve the problems
with perl than for instance with Microsoft C, Sun's C, ATT's ksh, etc.
since the person hired will have access to the source for making
changes.
--
Larry W. Virden <URL:mailto:lvirden@cas.org> ICQ: 5744965
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Wed, 11 Feb 1998 10:17:35 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Happy with Perl?
Message-Id: <34E1C10F.34BA@min.net>
nwi-tech wrote:
>
> net bods bite
> too many peoples heads off about simple things.
Maybe it's because these net bods don't have heads of their own?
John Porter
------------------------------
Date: Wed, 11 Feb 1998 10:22:05 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Happy with Perl?
Message-Id: <34E1C21D.3D87@min.net>
I R A Aggie wrote:
>
> Right. Like they can sue Microsquid. You _have_ read their license
> agreements, yes? you know the part where they decline liability for
> any damages done because of errors in their programs??
>
> At least with perl, you HAVE THE SOURCE AND YOU CAN FIX IT YOURSELF
> instead of HAVING TO WAIT FOR MICROSQUID TO a) acknowledge a problem
> exists, b) that its their problem, c) to work on the problem, and d)
> deliver a solution to you.
While agree 100% with James' sentiment, it may have been more
appropriate to talk about AT&T/BSD/Sun/HP/SCO/..., since the
original poster is using sh on unix. I think Berkeley
actually still retains the rights to the sh source code...
And, of course, disclaims all liability.
John Porter
------------------------------
Date: Wed, 11 Feb 1998 15:38:30 +0100
From: "Hans Van Lint" <hvanlint@lodestar.be>
Subject: Help!! pattern matching
Message-Id: <6bsd36$qvg$1@news2.xs4all.nl>
Sorry to bother you again, but I wanted to explain something:
I have a form where you are able to fill in or don't fill in 8 fields.
When ready, you submit the form.
In my program I read lines from a text file, and then I look if the fields
filled in, exist in the resp. fields of the database.
I want it to look for field AND field AND ...
So, that's why I write $count++, and when, after checking the 8 fields,
$count = 8, I can show the record.
My code looks like this:
$count =0;
$countbij = 0;
if ($fnaambedrijf =~ /$input{'ubedrijf'}/i) { $countbij=1;}
#this is field 1 (if input in field then add 1 to count)
if ($fomschrbedrijf =~ /$input{'ubedrijf'}/i) { $countbij=1;}
if ($countbij == 1){ $count++; }
if ($fselbureau =~ /$input{'usbureau'}/i) { $count++; }
#field 2 (if input in field then add 1 to count)
$countbij = 0;
if ($ffunctie =~ /$input{'ufunctie'}/i) { $countbij=1;}
#field 3 (if input in field then add 1 to count)
if ($fbaseline =~ /$input{'ufunctie'}/i) { $countbij=1;}
if ($fomschrfunctie =~ /$input{'ufunctie'}/i) { $countbij=1;}
if ($countbij == 1){ $count++; }
if ($fprofiel =~ /$input{'uprofiel'}/i) { $count++;}
#field 4 (if input in field then add 1 to count)
if ($faanbod =~ /$input{'uaanbod'}/i) { $count++;}
#field 5 (if input in field then add 1 to count)
if ($finteresse =~ /$input{'uinteresse'}/i) { $count++;}
#field 6 (if input in field then add 1 to count)
if ($input{'upcvan'} eq ''){ $count++; } #field 7 (if input in field then
add 1 to count)
else{
if ($input{'upcvan'} < $fpostgem){ $count++; }
}
if ($input{'upctot'} eq ''){ $count++; } #field 8 (if input in field then
add 1 to count)
else{
if ($input{'upctot'} >= $fpostgem){ $count++; }
}
if ($count == 8){ $tonenfunctie = 1;} #if $count = 8 then show line
Well, I tried everything already, and it just doesn't work.
Am I correct in thinking when a field is blank it automatically increases
$count?
(looking at the outcome it does, so that isn't be the problem I think)
eg:
I fill in one field let's say <ubedrijf> with the value: po
I submit my form:
What happens is this:
When input{'ubedrijf'} doesn't exist in $fbedrijf then it works, count
= 7
But when it does exist, count = 5 when it should be 8!!
I need help with this, cause I don't see the problem.
In my opinion it should work like this but it doesn't.
------------------------------
Date: 11 Feb 1998 14:59:16 GMT
From: trs@eerie.fr (Francois Trousset)
To: Guoguang Lu <guoguang@alfa.mbb.ki.se>
Subject: Re: Help
Message-Id: <6bsec4$68c$1@anais.eerie.fr>
In article <34DF4068.B60@alfa.mbb.ki.se>,
Guoguang Lu <guoguang@alfa.mbb.ki.se> writes:
>
> 1) If there is a Web address openned to public, could I write the data
> directly to an file instead of display on the Netscape screen (or MS
> exploer)? If yes, how?
>
> 2) If there is an anonymous ftp site, and I want to ftp an specialfic
> file from that site, does PERL allows to do it automatically? if yes
> how?
Hi,
Thereare 2 packages in perl that may respond to your need,
they are URI::URL and LWP which allows you to retrieve the
results of any http request in perl, you have then the
possiblity to do whatever you want with the text and even
put it in a file or display it on the screen or pipe it to
any filter you want... The package LWP also allows you to
send ftp request to a site and get back the result in you
perl program. Once again, you are allowed to do whatever
you want with the result, depending of your needs, putting
it in a file, or piping it to a filter... The documentations
with examples is include in the package (format pod).
Francois TROUSSET
------------------------------
Date: Wed, 11 Feb 1998 13:45:00 GMT
From: David Cross <Dave.Cross@gb.swissbank.com>
Subject: Re: how do I mail results in perl?
Message-Id: <y4diuqms1b7.fsf@gb.swissbank.com>
sls <sls@ni.net> writes:
> I have a program which runs in perl as follows:
>
> $ret = ./dfrun program
>
> $ret captures the results from the ./dfrun program.
>
> Now I want to mail that - the $ret
>
> how can I do this using the mail command?
Ask in comp.lang.perl.modules about the Mail::Send
and Mail::Mailer modules. They do all you require.
Dave...
--
"...but Man created all gods equal."
Dave.Cross@gb.swissbank.com
------------------------------
Date: Wed, 11 Feb 1998 15:50:41 +0100
From: Pascal AMRAM <pascal_amram@ml.com>
Subject: keyboard input in BLIND MODE
Message-Id: <34E1BAC0.564F81DD@ml.com>
I would like into a command prompt window under NT enter a password but
i don't want to see my password on the screen !
Have you some ideas ?
Regards
------------------------------
Date: 11 Feb 1998 14:57:39 +0100
From: Marek.Rouchal@hl.siemens.de (Marek Rouchal)
Subject: Re: Learning Perl
Message-Id: <6bsaoj$p2c@buffalo.HL.Siemens.DE>
In article <34E1783B.1339B430@nedernet.nl>, kees <kaddba@nedernet.nl> writes:
> I am implementing Software Configuration Management with ClearCase (and
> DDTS and Guide, eventually). These tools include Perl as language for
> automating functions and extending functionality.
>
> So what? Well, I want to use Perl (version 4), and I want to get to know
> it quickly. But without a decent introduction I tend to get lost in the
> complete syntax guides, I'm not a C programmer. Is there a good
> introduction course or book to show me the 'getting started' part of
> using Perl 4.
>
> I have to use Perl 4 because Rational supports the use of it with
> ClearCase (and my managers require support ;-).
AFAIK from ClearCase 3.x on the Rational tools use Perl 5.x. I know for sure
for ClearGuide. Definitely no Perl 4 in ClearGuide!
Your original question is answered by the fine Perl pages at
http://www.perl.com
HTH,
Marek
+--------------------------------------------------------------------+
Marek Rouchal
SIEMENS AG Phone : +49 89/636-25849
HL CAD SYS Fax : +49 89/636-23650
Balanstr. 73 mailto:Marek.Rouchal@hl.siemens.de
81541 Muenchen PCmail:Marek.Rouchal.PC@hl.siemens.de
+--------------------------------------------------------------------+
------------------------------
Date: Wed, 11 Feb 1998 13:41:16 GMT
From: David Cross <Dave.Cross@gb.swissbank.com>
Subject: Re: Learning Perl
Message-Id: <y4dk9b2s1hf.fsf@gb.swissbank.com>
kees <kaddba@nedernet.nl> writes:
> I have to use Perl 4 because Rational supports the use of it with
> ClearCase (and my managers require support ;-).
Perl 4 is years (four?) out of date and is known to has major bugs in it.
This is one of the reasons Perl 5 was created.
Please try to persuade you managers to let you upgrade.
If asking nicely doesn't work, take the gloves on and say
'There are no plans to make Perl 4 Y2000 compliant'
That should get them jumping!
Dave...
--
"...but Man created all gods equal."
Dave.Cross@gb.swissbank.com
------------------------------
Date: Wed, 11 Feb 1998 10:10:27 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Matt's Script Archive
Message-Id: <fl_aggie-1102981010270001@aggie.coaps.fsu.edu>
In article <34e0c93e.164189402@news.cnnw.net>, cowboy@cnnw.net (James L.
Taylor) wrote:
+ haven't found any problems with them, I don't know much about perl at
+ all but just looking at how he has written tham has taught me some
+ good things...
I hope he hasn't taught you to roll-your-own un-webifying code for use
in CGI's. I hope you've learned to use CGI.pm instead?
Last I looked, Matt was _not_ using CGI.pm in his scripts.
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: 11 Feb 1998 15:40:23 GMT
From: smcnabb@NO@%SPAMinterlog.com (Steve McNabb)
Subject: My Module: To release or not to release...
Message-Id: <6bsgp7$4ka$1@nntp3.uunet.ca>
Hi all:
(right off the bat, I've looked around on the FAQ's for an answer to this, but
haven't found any notes about it, so cool those fingers-of-flame ;-)
So, I've written this nifty little module which I think might be useful to the
rest of the world someday, but I'm not sure it's "worthy" of release.
What is it? : A little progress indicator bar (you know, you are 30% done a
process, so it shows you a little bar that is 30% green and 70% red) with a
nice little 3-d edge bevel effect
Why is it useful? : it takes (by default) two values via cgi : score and
total (score out of total) and returns a gif. (I use the perl script as an
image tag)
I use it for "step by step" web wizards (step 1: do this, step 2: do this,
etc) and for score values in little web CBT applications
So what I'm asking is, should I bother releasing this to CPAN? I want to
contribute my $0.25 to the Perl universe, but I don't want to release something
if it's not "appropriate" or whatever.
Also, I'm a relative newbie Perl hacker (I've been programming for about 4
months or so) so my code may not be the best in the universe, but I figure it's
better to release something (and have it critiqued by the rest of the community
for elegance, "safeness", efficiency, etc) rather than release nothing at all.
So, can I get a little feedback about this?
Thanks!
Steve
Steve@tralt***SPAM***.com (del ***->***)
(b.t.w. : props to Tom and all the other comp.lang.perl.misc advice givers --
we all appreciate all the time and effort you go to in order to help people you
don't know, for free :)
------------------------------
Date: Wed, 11 Feb 1998 14:03:11 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e1af33.3869814@10.0.2.33>
On 11 Feb 1998 00:59:02 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, using a forged address now revealed for all the
>world to grep, intervisors@intervisors.nl writes using the asquerous
>Forte Free Agent 1.1/32.230:
Prithee, what does asquerous mean? None of the dictionaries at my
disposal, both online and print, cast any illumination on the subject.
(My copy of the OED is at the cleaners...yeah, that's it!)
------------------------------
Date: 11 Feb 1998 07:29:35 -0800
From: marto@ccnet.com (Mike Artobello)
Subject: Running Perl via Shell vs CGI
Message-Id: <6bsg4v$f0k$1@ccnet3.ccnet.com>
I have a question regarding spawned processes. When running under a
shell, I always code a reaper routine to catch child termination and
prevent zombies. Is this also required if running under CGI? For example,
piping to sendmail spawns a child process, so I reap it when running
under a shell, however, CGI scripts, such as Matt Wright's formmail
don't use reaper code. Does CGI automatically reap child processes?
Just to be safe, I've included the reaper code in my CGI scripts, but is
this really necessary?
Thanks in advance.
--
Regards,
Mike
____________________________
Mike Artobello (Concord, CA)
email: marto@ccnet.com
WWW: http://www.ccnet.com/~marto
------------------------------
Date: 11 Feb 1998 15:16:29 GMT
From: gbraden@visi.net.remove (G Braden)
Subject: syntax error
Message-Id: <6bsfcd$r38$1@reznor.larc.nasa.gov>
I am fairly new at Perl, but I been puzzling over this for two days.
I adapted (rewrote/modified) a flatfile database program and keep getting
internal server error messages. When I run the perlscript online, I get the
following:
'ash: syntax error near unexpected token `"POST")
'ash: ./phoneb.cgi: line 18: `if ($ENV{'REQUEST_METHOD'} eq "POST")
I been over the code, retyped it, had others look at it, and now I am
stumped. The code (snipplet) in question is as follows:
if ($ENV{'REQUEST_METHOD'} eq "POST")
{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/,/ /;
$contents{$name} = $value;
}
}
Does anyone have a suggestion?
Thanks in advance...
I get the
following error when I
--
To reply, remove '.remove' from my email address
------------------------------
Date: Wed, 11 Feb 1998 10:11:58 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: To All Perl Guru's
Message-Id: <fl_aggie-1102981011580001@aggie.coaps.fsu.edu>
In article <6bqi3h$he5$5@marina.cinenet.net>, cberry@cinenet.net (Craig
Berry) wrote:
+ server. CGI.pm is helpful in this regard, as it notices when it's being
+ run 'offline' and lets you hand-enter pseudo-form data.
Shoot, not only that, you can tell it to use a file as the CGI input...
James - rather useful, for long forms... :)
--
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: Wed, 11 Feb 1998 08:58:27 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Web page does not display all output of cgi !!!!!
Message-Id: <34E1BC93.E468C522@houston.Geco-Prakla.slb.com>
Nick Djurovich wrote:
>
> Hi,
> I've written a cgi script to format a file and output it line by
> line. Only a *fixed* amount
> of output appears in the web. I have test procedures, which output
> useful debugging information
> to a logfile, to mirror what's output to the web, and that shows the
> data is complete, so the
> browser is being sent the information but it's not displaying it.
>
> Sounds to me like some bufffer's full somewhere, and it's not being
> flushed ?
> Is there a limit on Netscape's input buffer or something like that ?
>
> /Nick
Nick,
Just as a test, once you have the page up, try viewing the page source.
I found that one of my pages was doing this because of bad html
formatting (missing close tag for a table, if I recall). If I did a
'view source' under Netscape, it actually showed all of the code.
Perhaps your problem is the same?
Another thought: Are you using buffered output? In other words, did
you set $| = 1 to cause unbuffered output?
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
------------------------------
Date: Wed, 11 Feb 1998 08:23:42 -0600
From: Derek Balling <dballing@speedchoice.com>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <C5C213BF9F942A6B.FDAE3CB50D37E998.C5A5520FEA4B4C65@library-proxy.airnews.net>
Bart Lateur wrote:
> My solution would be to make the software less tolerant. For instance,
> "cal" could simply reject a two digit year.
That's not very friendly. What would be more friendly is to display the
year
using printf "%4d",$year, so that it shows as "February 0098" to
emphasize to the user that they're looking far in the past. It's
entirely possible someone would WANT to see a calendar from that far
back, so its best to allow them to do so.
> Perl's functions should always have returned 4 digit years.
But, as we all know, they've returned "years since 1900", which is an
interesting way of saying "we WEREN'T compliant, but the values you get
in 2000 will be 'x', and not just 00's."
------------------------------
Date: Wed, 11 Feb 1998 09:59:17 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <1d4a5bq.1o5e8ko1ky3wg0N@roxboro0-002.dyn.interpath.net>
In comp.lang.perl.misc Bart Lateur <bart.mediamind@tornado.be> wrote:
> Yet another excellent brainchild from Tom Christiansen. Just some
> thoughts:
>
> >Most of the time that people think about dates, they use only the
> >final two digits of the year. They write it on checks. They write in
> >family Bibles. You hear someone casually say, "I remember back in '65,"
> ...
-snip-
> >And no one has yet figured out how to fix the wetware.
>
> My solution would be to make the software less tolerant. For instance,
> "cal" could simply reject a two digit year.
>
> Call it nagware, if you like. Whenever one of your programs gets some
> user input that is supposed to be a year, in a GUI, and it consists of
> just two digits, then pop up a messagebox:
>
> Excuse me, is that 1915 or 2015?
>
> Doubts resolved.
>
> Soon enough, the operators will learn.
Why? It's a convient short hand that people can understand perfectly
well and that computers (with a little work) can understand reasonably.
Accept a 2 or 4 digit input and if it's a 2 digit and then use some
logic to try to figure it out - 99.99% of the time it's going to be in
the same decade at least, hell at least half the time it's probably
going to be THIS year. Computers should be able to handle this without
excessive user input.
--
John Moreno
------------------------------
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 1858
**************************************