[12908] in Perl-Users-Digest
Perl-Users Digest, Issue: 318 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 20:17:14 1999
Date: Fri, 30 Jul 1999 17:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 30 Jul 1999 Volume: 9 Number: 318
Today's topics:
Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <cassell@mail.cor.epa.gov>
Problems with use/require .... <msh@kar.net>
Query web server O/S mkx@excite.com
Re: Re: How to read the submit button as a name or valu <mike@crusaders.no>
Re: Re: How to read the submit button as a name or valu <tchrist@mox.perl.com>
Re: Re: How to read the submit button as a name or valu (Abigail)
Redirecting a picture? <shades__@mitec.net>
retrieve/calculate file checksum dalesyk@my-deja.com
Re: submit to another form (Abigail)
Re: Trouble shooting please!!! <cassell@mail.cor.epa.gov>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 30 Jul 1999 16:31:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37A235CD.C5DA51AC@mail.cor.epa.gov>
John Callender wrote:
>
> In comp.lang.perl.misc mike cardeiro <mikecard@my-deja.com> wrote:
> > arent you all the same people who are always whining about the signal to
> > noise ratio whenever a newbie asks a question
>
> This is one of those "all animals were created equal, but some are more
> equal than others" kind of things. It *is* interesting, though, that
> Tom and Abigail, who tend to fall toward the harsher end of the
> spectrum in their views regarding the influence of newbies in the
> group, have given some exceptional examples lately of posting behavior
> that, if it came from a newcomer, would be cited as a prime example of
> how not to behave.
I will now take an unpopular position. I *like* a lot of
the off-topic silliness in this ng. I mean, Perl is a fun
language, and we should be allowed to have fun with it.
When Ernie Brouwer [a brand-spanking-new poster AFAIK]
dropped in his Jabberwocky parody, was he chewed up and spit
out? No. Tom's posting is relevant to ongoing conversations
in this newsgroup [as well as elsewhere in the Perl world],
so I think it is legit.
After all the smart@$$ posts I've made, it would be fairly
hypocritical of me to take any other position.
> Clearly, Tom and Abigail have contributed mightily to the group, and
> deserve to take whatever liberties they like. For myself, I consider
> their off-topic stuff more interesting than the on-topic postings. It's
> the nature of Usenet, anyway, that in a non-moderated group everyone
> pretty much gets to say whatever the hell they want, and you end up
> with a clear picture of what makes a given individual tick, warts and
> all.
Yes, unmoderated newsgroups do that. So they degenerate, unless
some set of personalities takes the role of Newsgroup Gods (tm).
Look at what some of the newsgroups around us have descended to.
But I like the direction of this newsgroup, so feel free to
ignore my opinion.
> In that sense, Usenet is impressively democratic. Tom and Abigail are
> free to bitch about newbie repostings and Web discussion while engaging
> in similar behavior themselves, but by the same token you and I get to
> chatter about their hypocrisy in doing so.
Well, I don't think of Tom's PerlFAQ and Perlfunc postings as
a bandwidth-waster. In fact, I've learned a few more things
from re-reading them. And I've made a few corrections, most
of which were graciously integrated into the docs by Tom.
Okay, so a few were rejected out of hand. :-)
I do think that someone needs to explain to newbie off-topic
posters that there are other newsgroups where they can get
better answers. It helps those posters to learn about other
newsgroups and what those newsgroups cover. Of course, it
doesn't help those posters to be told that they are lower
than Newt Gingrich's belly. I try to be polite but firm..
although I fail now and then.
> It's the regulars' appreciation of the shortcomings of that sort of
> democracy, and their desire for something better, that leads to the de
> facto aristocracy (or, more properly, meritocracy) under which a given
> utterance is classified as noise or signal based on who said it, rather
> than what was said.
I like meritocracies. And what newsgroup doesn't have a
meritocracy? A quick perusal of alt.humor.best-of-usenet
will demonstrate that such structure is The Way Usenet Works.
Dozens, if not hundreds, of different newsgroups acting
in a similar fashion to this one.
Those who 'own' the newsgroup, or at least drive it, get
to have more say than random nomads who drop by for a few
nanoseconds.
> But yeah, from a certain perspective it does suck.
I think that there is a certain amount of looseness in
the interpretation of 'off-topic'. And I think that the
interpretation differs from discussions to questions. I
don't think that's bad either. I would hate to be deprived
of the next Perl parody due to undue ng strictures. I
would not mind being deprived of the next 'how do I make a
Back button' question.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 10:57:41 +0300
From: "Maksym Y. Shevchenko" <msh@kar.net>
Subject: Problems with use/require ....
Message-Id: <7nrlr8$28f$1@mail.kar.net>
I have 3 files in same directory:
aaa.pl bbb.pm ccc.pl.lib
Here are sources of them:
# -----------------aaa.pl----------------
#!/usr/local/bin/perl
use bbb;
require "ccc.pl.lib";
print "In main!\n";
print &ccc,"\n";
print bbb->b(),"\n";
#----------------------------------------
# -----------------bbb.pm--------------
package bbb;
require "ccc.pl.lib";
sub import {
return 1;
}
sub b {
return "In bbb::b!".&ccc;
}
1;
#----------------------------------------
# -----------------ccc.pl.lib-------------
sub ccc {
return "In \&ccc!";
}
1;
#----------------------------------------
Why I got a:
./aaa.pl
In main!
Undefined subroutine &main::ccc called at ./aaa.pl line 7.
How I undersand refence to &ccc must be defined from main class and from bbb
class,
but defined only from bbb class... Why?
PS Plz send a copy of your answer to mailto:msh@kar.net too. Tnx.
--
WBR Maksym Y. Shevchenko
------------------------------
Date: Fri, 30 Jul 1999 22:55:51 GMT
From: mkx@excite.com
Subject: Query web server O/S
Message-Id: <37a32cc8.27316749@news.supernews.com>
I am attempting to write a script which queries a webserver to
determine it's type (Apache,IIS,etc.) and the host operation system. I
have managed to get the webserver simply by reading the headers. But I
am unsure how to query the O/S. Any ideas or samples?
www.netcraft.com/whats has managed to do just this, I just do not know
how.
------------------------------
Date: Sat, 31 Jul 1999 00:15:55 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <Bwpo3.530$Y87.5968@news1.online.no>
Tom Christiansen <tchrist@mox.perl.com> wrote in message
news:37a1f44a@cs.colorado.edu...
> Floyd Morrissette <Webdesigner@NewWebSite.com> writes:
> :I have a question. Its seems to me that it would be better, if all you
> :want to do is read and parse, to cut and paste the ReadParse sub from
> :CGI.pm to the script where you want to use it. That way the server does
> :not have to read and compile and execute the entire 200k+ CGI.pm module.
> % time perl -MCGI -e 1
> 0.062u 0.009s 0:00.08 36.8%
> Don't blink. You'll miss it.
Hmm, seems like I need to have a little chat with the sysadmins at work.
Where I work, use of CGI.pm is considered to be a crime punishable by
intense public humiliation, so they've created a simple GET/POST request
parser instead. The only reason I've ever heard about this is that it
demands far too much resources.
--
Trond Michelsen
I want my, I want my, I want my C-G-I
------------------------------
Date: 30 Jul 1999 16:20:50 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <37a22542@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Trond Michelsen" <mike@crusaders.no> writes:
:Hmm, seems like I need to have a little chat with the sysadmins at work.
Yup.
:Where I work, use of CGI.pm is considered to be a crime punishable by
:intense public humiliation,
Here you'll find the opposite to be true. :-)
:so they've created a simple GET/POST request
:parser instead.
I bet they didn't get as much right as Lincoln did. More eyes.
:The only reason I've ever heard about this is that it
:demands far too much resources.
Well, sure it does consume resources, but that's what you have a computer
for, eh? ;-)
--tom
--
"De gustibus non est disputandum."
------------------------------
Date: 30 Jul 1999 18:20:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <slrn7q4cov.hek.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLIX September
MCMXCIII in <URL:news:37a22542@cs.colorado.edu>:
!! [courtesy cc of this posting mailed to cited author]
!!
!! In comp.lang.perl.misc,
!! "Trond Michelsen" <mike@crusaders.no> writes:
!! :Hmm, seems like I need to have a little chat with the sysadmins at work.
!!
!! Yup.
!!
!! :Where I work, use of CGI.pm is considered to be a crime punishable by
!! :intense public humiliation,
!!
!! Here you'll find the opposite to be true. :-)
!!
!! :so they've created a simple GET/POST request
!! :parser instead.
!!
!! I bet they didn't get as much right as Lincoln did. More eyes.
!!
!! :The only reason I've ever heard about this is that it
!! :demands far too much resources.
!!
!! Well, sure it does consume resources, but that's what you have a computer
!! for, eh? ;-)
"Too much resources", that's a highly subjective measure.
While compiling CGI.pm and FileHandle.pm take about the same time on
my machine, you'll find people that advocate the use of CGI also claim
FileHandle pulls in thousands of lines and is a waste of resources. ;-)
It all depends on what your point of view is.
My PoV is that people who have problems enough with writing simple
programs correctly shouldn't be concerced about the overhead of a
module. By the time the extra overhead of a module takes more than the
extra time you spend writing the program, you're already dead, buried,
and forgotten.
More seasoned programmers will either know the extra overhead doesn't
matter anyway, or have some extra tricks up their sleeves to make the
extra overhead not matter (like mod_perl).
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 30 Jul 1999 17:49:43 -0700
From: "Daniel Ulrich" <shades__@mitec.net>
Subject: Redirecting a picture?
Message-Id: <37a22ccb@news5.newsfeeds.com>
I have been trying to write a script that will take a picture from one
server and return it to a browser. My problem is that all of the headers and
footers that are used by the different servers seem to be in no way the
same. I keep getting messed up pictures. Some of the time I output one too
many bytes and some times one too few. Is there any example of doing
something like this?
Thank You In Advanced
Shades__
PS: Please Respond To shades@mitec.net
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 30 Jul 1999 21:58:30 GMT
From: dalesyk@my-deja.com
Subject: retrieve/calculate file checksum
Message-Id: <7nt761$46e$1@nnrp1.deja.com>
How can I retrieve the checksum of a given file?
stat() doesn't seem to have a crc field. I guess
I could either trust the time last modified to be
accurate or calculate the crc within my perl
script. But I thought (perhaps incorrectly) that
a crc value would be buried in the (NTFS)
filesystem somewhere, and thus I would rather
retrieve it than deal with the overhead of
reading/checksuming the entire file. I need a
script that verifies integrity of around 6000
files. Any suggestions/pointers are greatly
appriciated.
Thanks,
dale.sykora@compaq.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 17:56:49 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: submit to another form
Message-Id: <slrn7q4bcg.h2a.abigail@alexandra.delanet.com>
cim (cim@local.ee) wrote on MMCLIX September MCMXCIII in
<URL:news:37a19048.241188517@news.uninet.ee>:
__
__ What I need is that this data (content from the form) is also posted
__ to another form on a different server (running similar script).
LWP::UserAgent.
But I think you better redesign your setup.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 30 Jul 1999 16:44:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Trouble shooting please!!!
Message-Id: <37A238E1.2A097ECC@mail.cor.epa.gov>
Tanvada Jagannadha wrote:
>
> Hi,
> I am stuck with a wierd problem. I'm working on a perl code and i am
> getting an error in the routine given belew:
> open(fpp, "r.txt")
> @array = <fpp>;
> foreach $key (keys(%FORM)) {
> for($n=0; $n<@array; $n++) {
> $temp = substr(@array[$n],0);
> if($key eq substr($temp,0,8){
> @arr = split(/^/, @array[$n]);
> * for($p=1; $p<@arr; $p++) {
> if($FORM{$key} eq @arr[$p]) {
> $score = $score + @arr[$p+1];
> }
> $p++;
> }
> }
> }
> }
Well, the code you *posted* has an error two line above the
starred line. Your parens don't match. Maybe the compiler
only figured out the problem a couple lines later.
But you appear to be trying to see if two arrays have
some sort of match/matches. You really ought to read
the FAQ to see a more efficient way to approach your
problem. This looks way more complex than it needs to
be.. in Perl, anyway. And are you using CGI.pm to
parse out your %FORM ?
The FAQ comes with every proper install of Perl, so
you ought to have access to it locally. If not, you
can read it at CPAN [www.CPAN.org] where you can find
tons of good Perlstuff.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 318
*************************************