[10017] in Perl-Users-Digest
Perl-Users Digest, Issue: 3610 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 1 18:05:32 1998
Date: Tue, 1 Sep 98 15:01:32 -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 Tue, 1 Sep 1998 Volume: 8 Number: 3610
Today's topics:
Reading regular expression from file <cstolpe@acm.org>
Script to process form for using NT and IIS 4.0 <rdmacmillan@hotmail.com>
Re: Script to process form for using NT and IIS 4.0 <rootbeer@teleport.com>
Re: Source in multiple files [Newbie] <rootbeer@teleport.com>
Re: Threading/forking simple(?) programs (Duke)
Re: Tom Phoenix: ANSWERS WANTED! <eashton@bbnplanet.com>
Re: Tom Phoenix: ANSWERS WANTED! (Honza Pazdziora)
Re: Tom Phoenix: ANSWERS WANTED! (Honza Pazdziora)
Re: Tom Phoenix: ANSWERS WANTED! <joneil@cks.ssd.k12.wa.us>
Re: Tom Phoenix: ANSWERS WANTED! birgitt@my-dejanews.com
Re: unlinking file if <= 1 hour <rootbeer@teleport.com>
user address <datanet@dnbs.net>
Re: user address (Alastair)
Re: user address (Matt Knecht)
Re: user address <rootbeer@teleport.com>
Re: Using <!--something--> <rootbeer@teleport.com>
Why Perl ? dn5006@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 01 Sep 1998 17:05:27 -0400
From: Chris Stolpe <cstolpe@acm.org>
Subject: Reading regular expression from file
Message-Id: <35EC6197.56B9678F@acm.org>
I am trying to read part of a regular expression from a file for use in
a comparison.
$regx = <EXPR>; # <= doesn't work.This works => $regx = "Foo|Bar";
chop($regx); # just for when reading from file
if (/^($regx)/) {
....
}
Does it work when I set it to a string because perl knows the value of
the string when it compiles the script but doesn't when I read from the
file because it doesn't know the value? How can I work around this?
Thanks
Chris Stolpe
cstolpe@acm.org
------------------------------
Date: Tue, 01 Sep 1998 17:05:03 -0300
From: Richard <rdmacmillan@hotmail.com>
Subject: Script to process form for using NT and IIS 4.0
Message-Id: <35EC536F.6B6FAB3E@hotmail.com>
Hi,
We are trying to set up a cgi script to process user input from a few
very basic forms. We would like to have one form which can handle all of
the forms with little or no modification.
I have found some scripts which can do this, but they are all Unix
based, and we are running IIS 4.0 on NT. Any thoughts on where to find
such a script ?
Thanks,
Richard
------------------------------
Date: Tue, 01 Sep 1998 21:30:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Script to process form for using NT and IIS 4.0
Message-Id: <Pine.GSO.4.02A.9809011430100.21048-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Richard wrote:
> Subject: Script to process form for using NT and IIS 4.0
> Any thoughts on where to find such a script ?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 01 Sep 1998 20:58:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Source in multiple files [Newbie]
Message-Id: <Pine.GSO.4.02A.9809011355260.21048-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Raj Subramani wrote:
> Subject: Source in multiple files [Newbie]
Contrary to popular belief, it is not necessary to include the word
"Newbie" in your Subject: line. :-)
> I have written some ftp related subroutines and put them
> in a file called fileFtp.pl
This sounds as if you've done part of what you need to do to make a
library.
> How do I link test.pl and fileFtp.pl when running?
I think you're wanting to use require(). Be sure to include the '1;' at
the end, as mentioned in perlfunc's section on require. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 01 Sep 1998 20:57:29 GMT
From: duke@co.kittitas.wa.us (Duke)
Subject: Re: Threading/forking simple(?) programs
Message-Id: <35ec59c5.615326132@mars.co.kittitas.wa.us>
On 27 Aug 1998 01:52:54 GMT, Zenin <zenin@bawdycaste.org> wrote:
>Duke <duke@co.kittitas.wa.us> wrote:
>> Sometimes it seems that bar(1) takes longer than foo(2) and my blocking
>> doesn't seem to take that into account.
> >snip<
>> If I block on waitpid($$) also then won't I just hang
>> forever since the original PID won't be done?
>
> The foo(2) child exits when it's done. If/when the foo(2) child
> finishes first, a "Zombie" or "defunct" process will be left in the
> process table until its parent (the main program) waits for it.
>
> So, even if foo(2) does finish first, bar(1) is free to reap foo's
> pid at any time. In this case, waitpid() won't block because foo
> is done and its pid is ready to be reaped, which should be fine.
>
> Look at it this way (dots are working code):
>
> Time------------------------------------>
> foo.....foo... foo.....foo....
> bar.....bar.. bar.......bar...
> ^ ^ ^
> wait wait wait
>
> Thus, we sync our access regardless of who takes longer to run,
> because waitpid() returns when foo is done or immediately if foo
> is already done before we called waitpid().
>--
>-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".
I hate to keep bothering you....
I seem to keep getting multiple foo's running which dogs down the read
times, then bar looks for the foo(2) filename which foo is not yet
done with, and bar(2) fails. Meanwhile I have foo(2) and foo(3)
running. I don't understand enough yet about IPC to figure this one
out or even how to troubleshoot.
I am running subroutines which (roughly) look like:
$cdreadprog = "fooprog";
$dataprocessprog = "barprog";
sub findtrack
{
find out which tracks on the CD to process.
}
sub cdread
{
system("$cdreadprog $cdreadargs $cdreadtrack");
system("mv $cdreadtrack-filename $tracknumber.ext");
}
sub dataprocess
{
system("$dataprocessprog $dataprocessargs $curtrack.ext");
system("mv $curtrack.ext2 $filename.correct");
}
#pseudosub MAIN
#{
findtrack();
put data from that into @tracks;
@datatracks = @tracks;
$dataindx = 0;
$curtrack = $datatracks[$dataindx++];
$cdreadtrack = shift(@tracks);
cdread();
foreach $cdreadtrack (@tracks)
{
my $pid = fork();
defined $pid or die "fork(): $!";
if ($pid)
{
cdread();
} else
{
exit dataprocess();
}
waitpid ($pid,0) ||
die "Child error: $?" if $?;
$curtrack = $datatracks[$dataindx];
$dataindx++;
}
dataprocess();
#}
Process dies when attempting dataprocess on second filename. Second
filename does not exist. I do a ps and find (2) cdread processes
going. One for 2nd track and one for the 3rd track.
Thanks again for all of your help!
duke
------------------------------
Date: Tue, 01 Sep 1998 20:05:23 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <35EC512E.43349E84@bbnplanet.com>
> You might want to reconsider if he's really being constructive --
> although he's certainly quite friendly! After tagging and reading
> hundreds (if not thousands) of postings from Tom Phoenix, I gathered
> them all into a series of files and ran 'diff' on them, from which I
> recognized this:
<--snipped pseudo analysis-->
if you really wish to quantify this phenomenon into a statistical and
thereby tangible , legible result i would recommend a better proof than
that. grep is a pretty lame tool for reliable word counts. a perl script
would do a much better job of it and you could format and graph the
results. frankly, if his style is so terriby annoying to you why not put
him in your killfile and be done with the matter? don't start slinging
pseudo-stats as proof of concept. youve made your point but i still
don't think you are correct in saying that he is not a constructive
poster. end of thread.
e.
------------------------------
Date: Tue, 1 Sep 1998 20:25:09 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <slrn6uom15.g6m.adelton@aisa.fi.muni.cz>
On Tue, 01 Sep 1998 14:35:21 GMT, Nathan V. Patwardhan <nvp@shore.net> wrote:
> Although I appreciate the fact that Tom Phoenix isn't mean to people,
> I'm sad to admit that I've recognized an ironic trend in his postings.
>
> Over the last year I've read a number of postings like "How do I make
> 'Perl redirect'?" and Tom's response: "Sounds like this is something
> related to your browser or server! You'll need to read the docs and
> FAQs and all that good stuff. Hope this helps!"
>
> And there are hundreds of responses like this on clpmisc! This is way
> too much with too little content!
Nathan, what answers would you recommend? He just points out that the
author of the original posting should read it once more before hitting
"Yes, post" to see if the answer isn't in huge part already contained
in the post. His answers to off-topics of FAQs in 95 % contain the
proper balance of actual help and note that the poster should use his
own brain to solve his own problems/task.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Tue, 1 Sep 1998 20:30:13 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <slrn6uomal.g6m.adelton@aisa.fi.muni.cz>
On Tue, 01 Sep 1998 17:42:54 GMT, Nathan V. Patwardhan <nvp@shore.net> wrote:
> $ diff rootbeer.*
> $
>
> *gasp*
>
> $ grep -ci faq rootbeer.*
> 10000
> $
[...]
Your statistics is missing the part about the questions he answers
and corelation between them and the answers. There is nothing wrong in
sending the same answer to the same question, IMHO.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Tue, 01 Sep 1998 13:56:57 -0700
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <35EC5F99.E873A568@cks.ssd.k12.wa.us>
John Porter wrote:
>
> Jerome O'Neil wrote:
> >
> > Nathan V. Patwardhan wrote:
> > And every one of them a polite pointer to the answers that
> > the person is looking for.
>
> Check again. Tom is (almost) always polite, but his answers
> RARELY provide any real insight or direction.
I quite strongly disagree. When a person is asking CGI, web server, and
other off topic questions, the (I'll try and quote here) "...FAQs,
documents, and newsgroups for those topics..." are clearly the directon
one should go if they wish to gain insight into the problem at hand.
> Much as I'd like to take him to task for it, I don't, because
> politeness is such a rarity around here.
Indeed.
> > Tom P is a legitimate Perl Stud and Good Guy in my book...
> > Jerome "Perl Gelding" O'Neil
>
> I'm not sure "gelding" is the word you want.
;-> I was raised on a dairy farm, and and well versed not only in the
terminology, but the method and practice as well. All I can say is
"OUCH!"
> Perl is powerful, but I'd hate to think it could do that to you.
I doubt it would be as popular as it is today if it could.
> Maybe "colt" is better. Hope this helps!
Nah... I'm an old man of 30. I'd like to say "Stalion" but the wife
would object. I suppose we might use "Ass" (not that some haven't
already), but I'm sure someone would take it out of context. :-)
Jerome "Perl Equestrian" O'Neil
------------------------------
Date: Tue, 01 Sep 1998 21:09:49 GMT
From: birgitt@my-dejanews.com
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <6shnqt$cka$1@nnrp1.dejanews.com>
In article <JCTG1.30$kE2.226493@news.shore.net>,
nvp@shore.net (Nathan V. Patwardhan) wrote:
> Tom, not to ruin your enthusiasm, spit, fire, etc., but I'm afraid
> that your approach has become ineffective. What you've ended up doing
> is adding more noise than would be present if you just ignored folks
> who are asking FAQs or web questions which are not specifically
> related to the Perl language.
Well, not to ruin your hopes of turning Tom Phoenix's behaviour in clpm
around to resemble the one of other posters, but I like to mention that
there are noises some people just don't mind to listen to and other's
they could go up the walls for.
So far, the other approaches (certainly, if you would ignore FAQ
questions, that would work, but so far most of you are NOT
ignoring FAQs) have not yet been proven to be more successful.
Isn't it time to understand that you can't make people read the FAQs ?
They do or they don't and it's NOT dependend on the way someone
formulates an answer to a FAQ question in clpm.
Tom Phoenix's answers are neither noisy, nor more uneffective than
other answers. They just have their own style and culture. (Uhm,
wasn't there recently a very noisy thread where people had the nerves
to justify their "style" with having a certain "culture" - wow, what
a culture, I am impressed, chapeau !)
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 01 Sep 1998 20:49:42 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: unlinking file if <= 1 hour
Message-Id: <Pine.GSO.4.02A.9809011345200.21048-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Ed Henderson wrote:
> Tom Phoenix wrote:
>
> > On Mon, 31 Aug 1998, Ed Henderson wrote:
> >
> > > If all the files are in a single directory, this will work:
> > >
> > > my $expiration_time = 1 # Time in hours;
> > > # $path set to path where target file(s) exist.
> > > unlink grep { (time - (stat )[9]) > 60*60*$expiration_time } <$path/*>;
> >
> > No, there's a more subtle bug in that code than the obvious one; it's
>
> This sentence is unclear... what is the obvious bug?
Isn't it obvious? :-) If you try running it, Perl immediately complains
about the missing semicolon. (Putting a semicolon in a comment doesn't
count.)
> > assuming that $path points to the current directory. Since the stat will
> > (most often) fail, nearly every file in the given directory will be
>
> Why will stat most often fail?
Well, that's my mistake. I was thinking the wrong thing about relative
paths. Of course, stat actually could fail, but in the real world that's
not likely to happen with that code. Sorry, my goof!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 1 Sep 1998 21:52:08 +0100
From: "Daniel O'Hare" <datanet@dnbs.net>
Subject: user address
Message-Id: <6shmr0$18d$1@energise.enta.net>
how do you find out the e-mail address etc. of a visitor
to your site?
------------------------------
Date: Tue, 01 Sep 1998 21:23:24 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: user address
Message-Id: <slrn6uot4o.4i.alastair@calliope.demon.co.uk>
Daniel O'Hare <datanet@dnbs.net> wrote:
>how do you find out the e-mail address etc. of a visitor
>to your site?
Ask them?
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Tue, 01 Sep 1998 21:24:21 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: user address
Message-Id: <9CZG1.114$7%3.620821@news2.voicenet.com>
Daniel O'Hare <datanet@dnbs.net> wrote:
>how do you find out the e-mail address etc. of a visitor
>to your site?
Ask them.
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: Tue, 01 Sep 1998 21:34:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: user address
Message-Id: <Pine.GSO.4.02A.9809011430530.21048-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Daniel O'Hare wrote:
> how do you find out the e-mail address etc. of a visitor
> to your site?
It sounds as if you're trying to get a remote user to give you some
information. Have you tried asking nicely for it? Of course, there's
nothing Perl-specific about being polite; if your programs were written in
C or FORTRAN, you'd still ask in the same basic way. :-) Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 01 Sep 1998 21:21:46 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Using <!--something-->
Message-Id: <Pine.GSO.4.02A.9809011419530.21048-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Ken Truitt wrote:
> open(SOURCE,"guestbook.html"); #open the file for reading only
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
And since this script seems to be run by a webserver, concurrency may be
an issue. You may need to use file locking.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 01 Sep 1998 19:58:39 GMT
From: dn5006@my-dejanews.com
Subject: Why Perl ?
Message-Id: <6shjlf$7e5$1@nnrp1.dejanews.com>
Try the following script:
#!/usr/bin/perl
print ":-) ";
while (<>) { print eval; print ( ($@ || "\n") . ":-)" ) }
You get the following prompt:
:-)
You have a super calculator, for instance:
:-) log 9
2.1972245773362195
:-) exp 10
22026.465794806714
:-) 1/0
Illegal division by constant zero in file (eval) at line 2, next 2 tokens "0;"
:-) (3-1)*5**2
50
Some silly statements:
:-) "Hello world"
Hello world
:-) $a = "Hello world"
Hello world
:-) $a
Hello world
And you can execute all Perl statements, define functions, or import and
execute a Perl script. This interactive Perl is great to learn Perl, to try
out Tom Christ 's Cook book.
Dat Nguyen
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
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 3610
**************************************