[9738] in Perl-Users-Digest
Perl-Users Digest, Issue: 3333 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 3 19:05:36 1998
Date: Mon, 3 Aug 98 16:01:29 -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 Mon, 3 Aug 1998 Volume: 8 Number: 3333
Today's topics:
Re: hiding user input (Kelly Hirano)
Re: hiding user input <dgris@rand.dimensional.com>
Re: hiding user input <jdporter@min.net>
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Gary L. Burnore)
Re: hiding user input (Chris Nandor)
Re: hiding user input <jdporter@min.net>
Perl 5 bug list (Alex McLintock)
Re: running part of script as another user (Andrew M. Langmead)
Re: Sort <jdporter@min.net>
substr vs. pattern matching: which is faster? (Robert Watkins)
Re: substr vs. pattern matching: which is faster? <rick.delaney@shaw.wave.ca>
Re: substr vs. pattern matching: which is faster? (Larry Rosler)
Re: substr vs. pattern matching: which is faster? <jwdavison@lucent.com>
Re: Using pointers (John Moreno)
Win32::Registry module missing <tomr@frascati.demon.co.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Aug 1998 13:55:37 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: hiding user input
Message-Id: <6q5849$d98@Xenon.Stanford.EDU>
In article <35c71d9c.100029363@nntpd.databasix.com>,
Gary L. Burnore <whatpartofdontemailme@dontyouunderstand> wrote:
>As for you-know-who's comments that dejanews doesn't show any posts for me
>from comp, I've corrected that by removing X-No-Archive yes from all comp
>groups except this one. If someone were to really WANT to know what I post,
>I'm sure they could figure it out on their own, but you can feel free to check
>comp.unix.sco* comp.security.* comp.*.sendmail etc.
on a slightly different note...
i think clpm is a different beast than those mentioned above. how many casual
users know what sendmail is? one of the problems is that perl is a buzzword
and more untrained people are getting into learning perl because they equate
perl with cgi programming. since cgi programming is used on the web and the
web is so popular, the level of exerperience on this newsgroup is dropping.
while email is just as important as the web (if not more important), people
aren't bringing up systems that use sendmail like they're creating silly web
pages.
does anyone read any java newsgroups? i would imagine something similar is
happening on those, although perl has been around a bit longer...
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: Mon, 03 Aug 1998 21:25:53 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: hiding user input
Message-Id: <6q58v2$fh$1@rand.dimensional.com>
In article <35c71d9c.100029363@nntpd.databasix.com>
whatpartofdontemailme@dontyouunderstand wrote:
>As for you-know-who's comments that dejanews doesn't show any posts for me
>from comp, I've corrected that by removing X-No-Archive yes from all comp
>groups except this one.
First off, I have a name, and it would be common courtesy to use it.
>In THOSE groups people have not abused like they do here. In THOSE groups
>people don't feel the need to email people privately for every damn post they
>follow up to. In THOSE groups people POLITELY point to the faqs instead of
>rudely.
Yes, but do you hide under an X-No-Archive while you troll THOSE groups?
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Mon, 03 Aug 1998 21:56:23 GMT
From: John Porter <jdporter@min.net>
Subject: Re: hiding user input
Message-Id: <35C6328C.2EF6@min.net>
Gary L. Burnore wrote:
>
> On 3 Aug 1998 19:59:49 GMT, in article <6q54rl$f1o@scel.sequent.com>,
> krader@sequent.com (Kurtis D. Rader) wrote:
> > I second Mr. Porter's offer. Anyone who is being threatened or
> > harassed by Mr. Burnore should feel free to contact me
> > privately if Mr. Burnore contacts their company or business associates.
>
> Yup. And they'll say USENet is USENet and email is not USENet.
Maybe you should let others speak for themselves; have some faith that
those you suppose are actually clueful will say the right thing.
(btw, "USENet" is a pretty unusual way to write that.
For fun, I did an AltaVista search on the frequency:
"usenet": 510,000
"USENET": 95,000
"UseNet": 15,000
"USENet": 800
)
--
John Porter
------------------------------
Date: Mon, 03 Aug 1998 22:03:23 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cb3368.105610800@nntpd.databasix.com>
On 3 Aug 1998 20:21:25 GMT, in article <6q5645$jki$2@info.uah.edu>,
gbacon@cs.uah.edu (Greg Bacon) wrote:
>I'm not trying to be clever. Whose fault is it if the point zips
>right by someone's head? It's not as though I'm being obscure in
>pointing out Gary's propensity toward the ad hominem.
Yet you used it over and over to those who simply disagreed with you during
the RFD for .moderated.
>
>: Then, when I call him on this, he follows it up with an attack
>: questioning my buddha-nature.
>
>Why don't you call Gary on his abuse of ad hominem?
Translation:
"Whaaah, he can do it so I can too even tough I was doing it before. Waaaah".
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 22:04:12 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cc33c1.105699175@nntpd.databasix.com>
On Mon, 03 Aug 1998 20:25:21 GMT, in article <35C61D37.52BF@min.net>, John
Porter <jdporter@min.net> wrote:
>Gary L. Burnore wrote:
>>
>> I am going to set up a nice little procmail filter
>> that works specifically for this group
>
>You mean like a spam filter?
No, my spam filters only filter. This one will do a bit more in the form of a
reply.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 22:05:59 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cd340d.105775382@nntpd.databasix.com>
On Mon, 03 Aug 1998 16:34:30 +0000, in article
<35C5E683.6C7CCB75@interactive.ibm.com>, John Call <johnc@interactive.ibm.com>
wrote:
>Steve Linberg wrote:
>
>> Nowadays people want free fixes for brain-dead, broken code, ask Perl
>> questions that show they know *nothing* about programming at all, let alone
>> Perl, and cop attitudes when people (occasionally rudely) direct them to
>> the resources they should have read in the first place and where their
>> answers lie.
>
>Your points are well taken. It does seem to be an almost unsolvable problem.
>There are a lot of people out there who don't want to learn for themselves
>but just want somebody to make it better.
>
>I like the idea of directing people to the faq in a standard manner, ie:
>
> Your answer is at www.perl.com/blah/blah
>
>or whatever we want to tell them. Then we just don't answer their question
>until they prove that they have read the appropriate faq, don't understand a
>certain part, and then present to us what they don't understand. Then we can
>help them.
That's not the same as "What's wrong with your eyes that you didn't read the
faq..."
>Who knows? I just know we could have a happier community if we can get past
>some of the pettiness.
Indeed.
>Maybe I'm more of a social engineer.
Possibly an optomistic social engineer.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 22:09:55 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35ce3481.105891429@nntpd.databasix.com>
On 3 Aug 1998 13:55:37 -0700, in article <6q5849$d98@Xenon.Stanford.EDU>,
hirano@Xenon.Stanford.EDU (Kelly Hirano) wrote:
>In article <35c71d9c.100029363@nntpd.databasix.com>,
>Gary L. Burnore <whatpartofdontemailme@dontyouunderstand> wrote:
>>As for you-know-who's comments that dejanews doesn't show any posts for me
>>from comp, I've corrected that by removing X-No-Archive yes from all comp
>>groups except this one. If someone were to really WANT to know what I post,
>>I'm sure they could figure it out on their own, but you can feel free to check
>>comp.unix.sco* comp.security.* comp.*.sendmail etc.
>
>on a slightly different note...
>
>i think clpm is a different beast than those mentioned above. how many casual
>users know what sendmail is? one of the problems is that perl is a buzzword
>and more untrained people are getting into learning perl because they equate
>perl with cgi programming. since cgi programming is used on the web and the
>web is so popular, the level of exerperience on this newsgroup is dropping.
>while email is just as important as the web (if not more important), people
>aren't bringing up systems that use sendmail like they're creating silly web
>pages.
You picked one of the three I mentioned. Most "casual" users don't even LIKE
the word UNIX. As for comp.security, we don't see a lot of "I locked myself
out of the house, what should I do" kind of posts. As for sendmail, I'm only
guessing that more than 50 percent of UNIX machines use it. I know most old
SCO systems use MMDF but many are moving to sendmail.
>does anyone read any java newsgroups?
Yes.
>i would imagine something similar is
>happening on those,
Not nearly as it is here. They also don't email on posts they make either. >
>although perl has been around a bit longer...
It has. Which is why one would hope it'd be a bit different for people
starting out.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 22:11:46 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35cf3560.106114488@nntpd.databasix.com>
On Mon, 03 Aug 1998 21:25:53 GMT, in article
<6q58v2$fh$1@rand.dimensional.com>, Daniel Grisinger
<dgris@rand.dimensional.com> wrote:
>In article <35c71d9c.100029363@nntpd.databasix.com>
>whatpartofdontemailme@dontyouunderstand wrote:
>
>>As for you-know-who's comments that dejanews doesn't show any posts for me
>>from comp, I've corrected that by removing X-No-Archive yes from all comp
>>groups except this one.
>
>First off, I have a name, and it would be common courtesy to use it.
>
>>In THOSE groups people have not abused like they do here. In THOSE groups
>>people don't feel the need to email people privately for every damn post they
>>follow up to. In THOSE groups people POLITELY point to the faqs instead of
>>rudely.
>
>Yes, but do you hide under an X-No-Archive while you troll THOSE groups?
More attacks from you-know-who. Go read the fucking groups, dickweed.
In case you haven't noticed it by now, when you attack, you get what you give
with a bit extra added.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 22:16:05 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35d23688.106410320@nntpd.databasix.com>
On Mon, 03 Aug 1998 21:56:23 GMT, in article <35C6328C.2EF6@min.net>, John
Porter <jdporter@min.net> wrote:
>Gary L. Burnore wrote:
>>
>> On 3 Aug 1998 19:59:49 GMT, in article <6q54rl$f1o@scel.sequent.com>,
>> krader@sequent.com (Kurtis D. Rader) wrote:
>> > I second Mr. Porter's offer. Anyone who is being threatened or
>> > harassed by Mr. Burnore should feel free to contact me
>> > privately if Mr. Burnore contacts their company or business associates.
>>
>> Yup. And they'll say USENet is USENet and email is not USENet.
>
>Maybe you should let others speak for themselves; have some faith that
>those you suppose are actually clueful will say the right thing.
>
>(btw, "USENet" is a pretty unusual way to write that.
>For fun, I did an AltaVista search on the frequency:
>"usenet": 510,000
>"USENET": 95,000
>"UseNet": 15,000
>"USENet": 800
>)
It's unusual now. It wasn't <not saying how many> years ago.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Mon, 03 Aug 1998 18:45:20 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: hiding user input
Message-Id: <pudge-0308981845210001@192.168.0.3>
In article <35c82008.100649223@nntpd.databasix.com>,
whatpartofdontemailme@dontyouunderstand wrote:
# What it DOES look like is X-No-Archive: yes
Out of curiosity, what would you do if I posted the following to Usenet,
under your name?
#===============================================================================
From: gburnore@databasix.com (Gary L. Burnore)
Newsgroups: comp.lang.perl.misc
Subject: Re: hiding user input
Date: Mon, 03 Aug 1998 20:40:06 GMT
Organization: The Home Office in Wazoo, NE
Lines: 32
References: <6pnm5m$3gh1@webint.na.informix.com>
<35c6c6df.77821311@nntpd.databasix.com>
<6q4n0q$9l0$1@rand.dimensional.com>
<35c5eaad.86989000@nntpd.databasix.com>
<6q510k$ddj$1@rand.dimensional.com>
Reply-To: whatpartofdontemailme@dontyouunderstand
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Forte Agent 1.5/32.452
Xref: newsfeed.axxsys.net comp.lang.perl.misc:10004173
On Mon, 03 Aug 1998 19:07:04 GMT, in article
<6q510k$ddj$1@rand.dimensional.com>, Daniel Grisinger
<dgris@rand.dimensional.com> wrote:
>In article <35c5eaad.86989000@nntpd.databasix.com>
>Gary L. Burnore wrote:
>
>>Your opinion is that it's a troll. Your opinion means jack shit.
>
>I want to give you the benefit of the doubt and believe that you
>aren't a 14 year old troll, let's go look.
>
>I'll start with a search of the comp.lang.perl.misc archive
>at dejanews.
>Hmmm... not a single technical post from you, ever.
>This doesn't look good.
What it DOES look like is X-No-Archive: yes
>
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
This is a repost of Message-ID: <35c82008.100649223@nntpd.databasix.com>,
reposted purely for the purposes of archical, so the original author's
words can be used against him in the future.
#===============================================================================
Would that really piss you off? I am seriously considering doing it for
all of your posts here, and I just want to know your reaction beforehand.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Mon, 03 Aug 1998 22:56:13 GMT
From: John Porter <jdporter@min.net>
Subject: Re: hiding user input
Message-Id: <35C64092.6F6E@min.net>
Gary L. Burnore wrote:
>
> More attacks from you-know-who. Go read the fucking groups, dickweed.
>
> In case you haven't noticed it by now, when you attack, you get what you give
> with a bit extra added.
Wow.
Now I realize how "unwittingly wise" is was for you to set X-No-Archive.
However, for the benefit of everyone coming after us who might wonder
what a real man Gary Burnore is, I hereby enter his comment into
the archive.
--
John Porter
------------------------------
Date: Mon, 03 Aug 1998 21:03:24 GMT
From: alex.mclintock@removethisbit.earthling.net (Alex McLintock)
Subject: Perl 5 bug list
Message-Id: <902178156.19677.0.nnrp-11.9e982230@news.demon.co.uk>
The www.perl.com web site seems to suggest that there was an official bug list
database which is no longer current.
Is there one? (If this is a FAQ then _sorry_)
Alex.McLintock at rocketmail.com
------------------------------
Date: Mon, 3 Aug 1998 21:43:43 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: running part of script as another user
Message-Id: <Ex4v0w.LKF@world.std.com>
michel.colin@nirvanet.net (Michel Colin) writes:
>a perlscript is executed from a webpage. one of the parameter is the login of
>a user. the script must be run like it was runned from that user account
If you are on a unix system, and you are aware of the security
concerns involved, you are probably aware of Unix's setuid mechanisms
which changes the effective user id to the owner of the program (as
opposed to the caller.) and how the root user change to a new user id
through the setuid() call (available to perl through the $< variable)
If you are using Unix, but aren't aware of these features, you may
want to start on a crash course by reading some books on the Unix
programming environment and Unix security. After that, read the
perlsec man page to find out how these issues relate to Perl.
(You may want to consider hiring someone who has experience with these
issues. At a minimum, you might want to try to find someone to look
over the results of your work.)
--
Andrew Langmead
------------------------------
Date: Mon, 03 Aug 1998 22:50:10 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Sort
Message-Id: <35C63F27.62E0@min.net>
Jennifer Philips wrote:
>
> When using sort to sort a hash, is there a way of passing
> the hash I want to sort into the
> sort subroutine rather than declaring a global hash?
Can you show us the code for what you're currently doing,
and point out what about it you're dissatisfied with?
Thanks.
--
John Porter
------------------------------
Date: 3 Aug 1998 21:35:35 GMT
From: r-watkinsNOSPAM@worldnet.att.net (Robert Watkins)
Subject: substr vs. pattern matching: which is faster?
Message-Id: <6q5af7$kp0@bgtnsc02.worldnet.att.net>
I am using Perl to access an Access database using ODBC under NT. This is a
company directory so one of the fields is a phone number, and because it is an
international company, there are phone numbers from many countries. As such,
I have to decide how to format the numbers based on which country the record
belongs to. Now (at last!) for my question:
Would it be faster to use:
a]
if ($country eq 'X') {
$telephone_pre = substr($telephone, 0, 3);
$telephone_ext = substr($telephone, 3, 4);
}
or b]
if ($country eq 'X') {
$telephone =~ /(\d\d\d)(\d\d\d\d)/;
$telephone_pre = $1;
$telephone_ext = $2;
}
?
------------------------
Robert Watkins
Supervising Web Developer
Springer-Verlag NY, Inc.
rwatkins@springer-ny.com
http://www.springer-ny.com
********************
------------------------------
Date: Mon, 03 Aug 1998 21:43:14 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: substr vs. pattern matching: which is faster?
Message-Id: <35C63064.141C5673@shaw.wave.ca>
Robert Watkins wrote:
[snipped--subject says it all]
You can use the Benchmark module to compare the speed of different code
segments. Try it.
However, a quick search of dejanews would show you that substr is always
faster than pattern matching.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Mon, 3 Aug 1998 15:08:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: substr vs. pattern matching: which is faster?
Message-Id: <MPG.102fd49c1231c99e989751@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <6q5af7$kp0@bgtnsc02.worldnet.att.net> on 3 Aug 1998 21:35:35
GMT, Robert Watkins <r-watkinsNOSPAM@worldnet.att.net> says...
...
> Would it be faster to use:
>
> a]
> if ($country eq 'X') {
> $telephone_pre = substr($telephone, 0, 3);
> $telephone_ext = substr($telephone, 3, 4);
> }
>
> or b]
> if ($country eq 'X') {
> $telephone =~ /(\d\d\d)(\d\d\d\d)/;
> $telephone_pre = $1;
> $telephone_ext = $2;
> }
There is a Benchmark module designed specifically to allow you to answer
such questions for yourself. 'use Benchmark;' and look at the
documentation in Benchmark.pm.
As for your specific question, based on experience in *every* benchmark
of this kind I have run, 'substr' beats 'regex' handily every time. But
you should certainly try it youself and see. Somehow YMMV.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 03 Aug 1998 17:29:20 -0500
From: Joe Davison <jwdavison@lucent.com>
Subject: Re: substr vs. pattern matching: which is faster?
Message-Id: <xgou33t8zsv.fsf@nwswd131.ih.lucent.com>
r-watkinsNOSPAM@worldnet.att.net (Robert Watkins) writes:
> I am using Perl to access an Access database using ODBC under NT. This is a
> company directory so one of the fields is a phone number, and because it is an
> international company, there are phone numbers from many countries. As such,
> I have to decide how to format the numbers based on which country the record
> belongs to. Now (at last!) for my question:
>
Well, there's two things:
1. It's easy to find out which is faster, time them -- do each one 1000
(or 10,000 times, or 100,000 times -- however long it takes to get a
noticable difference) times and find out how much time they take. The
answer may well vary from machine (type) to machine (type).
2. More importantly, does it make sense to worry about that in this
program? I ask that because you say you're using ODBC. If I
understand ODBC correctly (I don't use it), you call a database with an
SQL query as a string -- the database figures out what you want, looks
it up and sends you the answer. If that's about right, the amount of
time you're spending in the ODBC call is going to be so much bigger
that it doesn't matter. It's like asking if you get to the front door
faster by walking through the living room or through the dining room
when you're on your way to the airport to fly to Rome. -- I mean, what
difference could it possibly make? The ODBC call will take at least
milliseconds, probably closer to seconds. The substr/pattern match
will take microseconds. -- the ODBC call will be at least hundreds, and
problably thousands of times longer than the slowest of either of them.
> Would it be faster to use:
>
> a]
> if ($country eq 'X') {
> $telephone_pre = substr($telephone, 0, 3);
> $telephone_ext = substr($telephone, 3, 4);
> }
>
> or b]
> if ($country eq 'X') {
> $telephone =~ /(\d\d\d)(\d\d\d\d)/;
> $telephone_pre = $1;
> $telephone_ext = $2;
> }
>
> ?
>
> ------------------------
> Robert Watkins
> Supervising Web Developer
> Springer-Verlag NY, Inc.
> rwatkins@springer-ny.com
> http://www.springer-ny.com
> ********************
>
>
--
Joe Davison jwdavison@lucent.com
Sure it doesn't work as well as it used to,
but think of all the money we're saving.
------------------------------
Date: Mon, 3 Aug 1998 17:00:16 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: Using pointers
Message-Id: <1dd732j.47bin112yblmoN@roxboro0-060.dyn.interpath.net>
Craig Berry <cberry@cinenet.net> wrote:
> : So what I wanted to do is use $pointer++ to move around in the C string
> : and also do the equivalent of the C *pointer==' '. If I can't do that I
> : guess it shouldn't be too hard to do it as a array and then use
> : indexing.
>
> There are two ways to attack this in Perl, each has good and bad points:
>
> 1. Use substr() and indices to read and write positions in the string. I
-snip-
> 2. Explode the string into an array of characters...
Yeah, I did the 2nd - I seemed to have had it right (all the problems I
had were in the translation, once I had those fixed it worked fine -
next time I use a editor with search and replace [I missed a lot of
$'s]).
--
John Moreno
------------------------------
Date: Mon, 3 Aug 1998 21:58:48 +0100
From: "Tom Ross" <tomr@frascati.demon.co.uk>
Subject: Win32::Registry module missing
Message-Id: <902178514.19255.0.nnrp-09.c2de33bc@news.demon.co.uk>
I've just upgraded to the latest version of ActiveState perl for Windows NT.
I have a number of scripts that manipulate my registry. After the upgrade I
can't run any of the scripts I get an error:
Can't locate Win32/Registry.pm in @INC (@INC contains:
G:\Perl\5.005\lib/MSWin32
-x86-object G:\Perl\5.005\lib G:\Perl\site\5.005\lib/MSWin32-x86-object
G:\Perl\
site\5.005\lib G:\Perl\site\lib .) at D:\users\tomr\reg.pl line 1.
BEGIN failed--compilation aborted at D:\users\tomr\reg.pl line 1.
I've searched the installation directories and it appears the this file is
missing even though I found a directory called Registry with the following
files:
Registry.bs
Registry.dll
Registry.exp
Registry.lib
The new documentation does not mention Registry module at all.
Has someone seen this problem ? Am I doing something wrong ? I think that
the installation went O.K. everything else is working as expected.
I still have the old Registry.pm file from the previous version and I
suppose I could use that but I'm not sure what effect that would have on the
rest of the system.
Any ideas ?
Tom Ross
tomr@frascati.demon.co.uk
------------------------------
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 3333
**************************************