[15943] in Perl-Users-Digest
Perl-Users Digest, Issue: 3356 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 14 18:11:15 2000
Date: Wed, 14 Jun 2000 15:11:03 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961020662-v9-i3356@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 14 Jun 2000 Volume: 9 Number: 3356
Today's topics:
Re: ANSI Perl: No Way !!! <nospam@nospam.com>
Re: ANSI Perl: No Way !!! <godzilla@stomp.stomp.tokyo>
Re: ANSI Perl: No Way !!! <russ_jones@rac.ray.com>
Re: ANSI Perl: No Way !!! <russ_jones@rac.ray.com>
Re: ANSI Perl: No Way !!! <care227@attglobal.net>
Re: ANSI Perl: No Way !!! (Jerome O'Neil)
Re: ANSI Perl: No Way !!! <uri@sysarch.com>
Bot for this group to auto-answer queries? <henry@penninkilampi.net>
build woes: perl5005_03 on AIX, DynaLoader <william.dowling@isinet.com>
Re: calculating date differences <Andreas.Kutschera@bln.siemens.de>
Re: calculating date differences <lr@hpl.hp.com>
Re: Can't find the syntax error! <russ_jones@rac.ray.com>
case sensitive pattern recognition.... law_40@my-deja.com
case sensitive pattern recognition.... law_40@hotmail.com
Re: case sensitive pattern recognition.... <Peter.Dintelmann@dresdner-bank.com>
Re: case sensitive pattern recognition.... <aqumsieh@hyperchip.com>
Re: case sensitive pattern recognition.... <sariq@texas.net>
Re: case sensitive pattern recognition.... <tina@streetmail.com>
Re: case sensitive pattern recognition.... <apage.net[remove]@usa.net>
Re: case sensitive pattern recognition.... <y-o-y@home.com>
Computer Programmer Profile <jenniferbNOjeSPAM@oreilly.com.invalid>
conection speed <horie@litho.eecs.berkeley.edu>
Re: CRONING DELETE OF DIRECTORY <Jonathan.L.Ericson@jpl.nasa.gov>
Re: CRONING DELETE OF DIRECTORY <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Diff. between putting & before a subroutine call <ender29@my-deja.com>
Re: Difficult regex: Update algorithm <burton@remove_this.lucent.com>
Re: Difficult regex: Update algorithm <iltzu@sci.invalid>
Re: distributing perl modules, programs <jbroz@transarc.com>
Re: distributing perl modules, programs <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jun 2000 17:09:26 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <8i8e86$l2o$0@216.155.33.144>
In article <394329E9.FB66C7AB@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:
| If I had it my way, Selena Sol would be in charge
| of Perl, in charge of its future direction, not so
| much its hard coding. She knows what she is doing
| and displays no ego problems. She is down-to-earth
| and lacking those qualities inherent to a snob.
Just a short FYI : Selena Sol is a fictitious name.
The Selena Sol website is now re-named to www.extropia.com, and has been
so for some time.
Eric Tachibana (a.k.a. Selena Sol), and Gunther Birznieks are the
founding members.
no further comment.
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Wed, 14 Jun 2000 11:00:16 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3947C830.21DD2290@stomp.stomp.tokyo>
The WebDragon wrote:
> "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> | If I had it my way, Selena Sol would be in charge
> | of Perl, in charge of its future direction, not so
> | much its hard coding. She knows what she is doing
> | and displays no ego problems. She is down-to-earth
> | and lacking those qualities inherent to a snob.
> Just a short FYI : Selena Sol is a fictitious name.
> The Selena Sol website is now re-named to www.extropia.com, and has been
> so for some time.
> Eric Tachibana (a.k.a. Selena Sol), and Gunther Birznieks are the
> founding members.
> no further comment.
==================
"Godzilla!" wrote:
> Dave Cross wrote:
> > On Sat, 10 Jun 2000 22:55:53 -0700, "Godzilla!"
> > <godzilla@stomp.stomp.tokyo> wrote:
> > Er... you _do_ know that Selena Sol is, in fact, a man
> > called Eric Tachibana[1] - and, judging by his public
> > scripts, his Perl skills are not exactly top of the class.
> I mentioned Socratic Irony right off.
> This method works well, yes? So far,
> just in this article thread only, I've
> caught two sucker fish, hook, line
> and sinker.
> You boys constantly claim me to be a moron?
> Shoot, I show you my bait right up front
> and you still take it....
brian d foy wrote:
> In article <394329E9.FB66C7AB@stomp.stomp.tokyo>,
> >"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> um, Selena Sol is definately not a female, and certainly not
> a Perl expert....
"Godzilla!" wrote:
> "Alan J. Flavell" wrote:
> > On Sun, 11 Jun 2000, Dave Cross wrote:
> > > On Sat, 10 Jun 2000 22:55:53 -0700, "Godzilla!"
> > > <godzilla@stomp.stomp.tokyo> wrote:
> > It's basically Los Angeles written backwards, right?....
==================
Make this, in total, four sucker fish caught,
along with numerous nibbles.
No further comment.
Godzilla!
------------------------------
Date: Wed, 14 Jun 2000 13:48:31 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3947D37F.60951242@rac.ray.com>
"Godzilla!" wrote:
<lots of valuable commentary snipped>
> [...]
> I will be quite candid with you. I don't like people here.
> Be sure of this. I don't like you people [...]
Do you like sitting on a hot stove? Do you like hitting yourself in
the head with a ball peen hammer? How about taking out your own
appendix with a shoe spoon?
"Doc, it hurts when I do this..."
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
When cryptography is outlawed, only outlaws will
A2bgg c4dc8 aji0i knS4E 7eFj8 22Rl1
ZdGg3 gu8i6 lu12N s6NoG gn3g3 q835n
------------------------------
Date: Wed, 14 Jun 2000 13:52:54 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3947D486.FA9A2DF9@rac.ray.com>
Drew Simonis wrote:
>
> I keep having the sneaking suspicion that there is some NG somewhere
> full of folks laughing there asses off.
Yeah, it's this one!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
When cryptography is outlawed, only outlaws will
A2bgg c4dc8 aji0i knS4E 7eFj8 22Rl1
ZdGg3 gu8i6 lu12N s6NoG gn3g3 q835n
------------------------------
Date: Wed, 14 Jun 2000 15:08:28 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3947D82C.8D9DCA9C@attglobal.net>
Russ Jones wrote:
>
>
> Do you like sitting on a hot stove? Do you like hitting yourself in
> the head with a ball peen hammer? How about taking out your own
> appendix with a shoe spoon?
I, for one, do not like hitting myself with a ball peen hammer
_anywhere_. It smarts.
------------------------------
Date: Wed, 14 Jun 2000 19:50:42 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <mmR15.1136$li3.22763@news.uswest.net>
Drew Simonis <care227@attglobal.net> elucidates:
> Russ Jones wrote:
>> Do you like sitting on a hot stove? Do you like hitting yourself in
>> the head with a ball peen hammer? How about taking out your own
>> appendix with a shoe spoon?
>
> I, for one, do not like hitting myself with a ball peen hammer
> _anywhere_. It smarts.
But it feels so good when you quit!
------------------------------
Date: Wed, 14 Jun 2000 20:31:38 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <x7pupk6m39.fsf@home.sysarch.com>
RJ> "Godzilla!" wrote:
>> [...]
>> I will be quite candid with you. I don't like people here.
>> Be sure of this. I don't like you people [...]
yet you keep hanging around. more signs of a deeply disturbed
person. didn't your parents teach you not to hang around people you
hate? i don't socialize with klansmen.
so your pain is self inflicted which make you a masochist as well. i
suggest switching over to another language group where you can feel even
worse (and happier it seems).
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Thu, 15 Jun 2000 07:26:01 +0930
From: Henry <henry@penninkilampi.net>
Subject: Bot for this group to auto-answer queries?
Message-Id: <henry-3C5BE7.07260115062000@news.metropolis.net.au>
Greetings!
I just finished building a bot.
This bot is programmed to continuously scan a given newsgroup, looking
for messages with the word "help" in the subject line.
It then extracts any other words on the subject line, and uses them as
keywords to search a local database. It ranks the matches, and then
posts a summary of all the articles back to the newsgroup as a response
to the original message.
Each individual article has a number. To retrieve specific articles,
all the poster need to is post another message and specify the article
number(s). The bot then responds with the full text of the requested
article(s).
Yes, it's just another way of dealing with FAQs.
A while ago, TomC had his FAQs being auto-posted to this group, and
people complained because they perceived the broadcast nature as noise.
Hopefully the "on-demand" nature of this system will placate those
individuals. I am unaware of any previous (or other) automated
mechanism.
My questions thus are:
Have there been any previous attempts at setting up an automated
response system for this group (or associated groups)? If so, what
happened to them?
Does this group even want such a system? Or are people happy with
things the way they currently are?
Any concerns/doubts as to the effectiveness of such a system?
Would anyone object to their responses (in this forum) being integrated
into the knowledge base (without additional correspondence)?
I basically figure that it would be nice to give the gurus of the group
the option of responding to a message with "Just ask the Bot". That
should help keep the stress levels down, and reduce the burn-out rate.
(Keep in mind that September is just around the corner.)
I've got the Bot sitting on a permanent connection just waiting to go.
If you folks want to give it a shake, then I'm perfectly happy to do
_all_ the admin and maintenance on the system. All I need is content
for the knowledge base, which is where you folks come in. Any time you
answer a question, and think it belongs in the knowledge base, just let
me know and it's in.
Well, that's the end of the pitch.
Henry.
------------------------------
Date: Wed, 14 Jun 2000 21:19:17 GMT
From: "William F. Dowling" <william.dowling@isinet.com>
Subject: build woes: perl5005_03 on AIX, DynaLoader
Message-Id: <3947F6C7.4BD94536@isinet.com>
Running 'make test' after building perl5005.03 from source on AIX 4.2.1
gives these errors (and no others):
op/readdir.........FAILED at test 3
lib/dosglob........FAILED at test 3
lib/filefind.......FAILED at test 1
lib/findbin........FAILED at test 1
Hoping this wasn't too serious, I did 'make install'; and although there
were some odd permissions problems (install seemed to make some
directories 444, which I manually changed to 555) I ended up with a perl
executable in my installation bin directory.
But when I run a test.pl script that does dynamic loading, I get this:
Uncaught exception from user code:
Can't locate auto/DynaLoader/dl_findfile.al in @INC
and indeed there is no dl_findfile.al anywhere in my installation
directory.
So:
1) Do I need to back up and solve the failures in 'make test' before I
go on?
2) If so, is this an AIX-specific configuration issue?
3) Or, am I really just looking at a (presumably less serious) problem
with install, where it is not copying something it should?
Thanks in advance for any pointers,
Will
--
William F. Dowling
Institute for Scientific Information
215-386-0100 x-1156
------------------------------
Date: 14 Jun 2000 17:45:49 +0200
From: Andreas Kutschera <Andreas.Kutschera@bln.siemens.de>
Subject: Re: calculating date differences
Message-Id: <8i89bd$7h1$1@de1bc6hd.bln.siemens.de>
sumera.shaozab@lmco.com writes:
>Hello,
>I am trying to calculate the current date with the date from last week,
>last month etc...and find the difference in days. I looked into the
>perl manip:date module but learned that it was not efficient since I
>will be calculating thousands of dates. What do you recommend I should
>do?
Depends on your date format. If you have time in seconds, why not just
use the difference between the two and divide by 60 * 60 * 24
(seconds * minutes * hours).
But that's too easy, huh?
If your time comes in a string like "Fri Aug 30 11:04:22 PST 1918"
it's probably a good idea to use Date::Parse, which is a lot smaller.
ciao
--
Andreas Kutschera, Siemens Business Services DS, Tel. 030/386-28089
Nonnendammallee 101, D-13629 Berlin Fax 030/386-22934
email: Andreas.Kutschera@bln.siemens.de
A "NOSPAM" in the subject line will definitely pass my SPAM-blocker :-)
------------------------------
Date: Wed, 14 Jun 2000 12:22:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: calculating date differences
Message-Id: <MPG.13b17b6bfc00ebf798ab7a@nntp.hpl.hp.com>
In article <8i83qj$shc$1@nnrp1.deja.com> on Wed, 14 Jun 2000 14:11:47
GMT, sumera.shaozab@lmco.com <sumera.shaozab@lmco.com> says...
> I am trying to calculate the current date with the date from last week,
> last month etc...and find the difference in days. I looked into the
> perl manip:date module but learned that it was not efficient since I
> will be calculating thousands of dates. What do you recommend I should
> do?
I recommend that you read the voluminous Perl FAQ, in particular this
one:
perlfaq4: "How can I compare two dates and find the difference?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Jun 2000 14:52:51 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Can't find the syntax error!
Message-Id: <3947E293.E9D06F15@rac.ray.com>
Gabe wrote:
>
> if (($tbldef->[$i]->[3] eq 'No') && (!$cgi->param($tbldef->[$i]->[0]))
>
> print
> $cgi->redirect('http://www.bestinsuranceinc.com/incomplete.html');
> }
It appears that you don't have an opening brace '{' after your 'if'
statement and before your 'print' statement. Along with the other
suggestions from Uri and Neil, I'd suggest that you get an editor that
does parentheses, brace and bracket checking.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
When cryptography is outlawed, only outlaws will
A2bgg c4dc8 aji0i knS4E 7eFj8 22Rl1
ZdGg3 gu8i6 lu12N s6NoG gn3g3 q835n
------------------------------
Date: Wed, 14 Jun 2000 16:02:08 GMT
From: law_40@my-deja.com
Subject: case sensitive pattern recognition....
Message-Id: <8i8a9i$21c$1@nnrp1.deja.com>
I have an if loop....
if ($array[$i] eq ("<smile>"){
do process.....
}
the problem is that <smile> could be <SMILE>, <Smile>, etc....
is there a way to do a check that is not case sensitive in this format?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 16:05:18 GMT
From: law_40@hotmail.com
Subject: case sensitive pattern recognition....
Message-Id: <8i8aff$24o$1@nnrp1.deja.com>
I have an if loop....
if ($array[$i] eq ("<smile>"){
do process.....
}
the problem is that <smile> could be <SMILE>, <Smile>, etc....
is there a way to do a check that is not case sensitive in this format?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 18:13:47 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <8i8av5$3t01@intranews.dresdnerbank.de>
Hi,
>if ($array[$i] eq ("<smile>"){
>do process.....
>}
>
>the problem is that <smile> could be <SMILE>, <Smile>, etc....
>
>is there a way to do a check that is not case sensitive in this format?
what about making them both lowercase using lc()
before testing for equality?
if (lc $array[$i] eq lc ("<smile>") ) {...}
Regards,
Peter Dintelmann
------------------------------
Date: Wed, 14 Jun 2000 16:15:05 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <7ahfaw9r3q.fsf@merlin.hyperchip.com>
law_40@my-deja.com writes:
> I have an if loop....
>
> if ($array[$i] eq ("<smile>"){
> do process.....
> }
>
> the problem is that <smile> could be <SMILE>, <Smile>, etc....
>
> is there a way to do a check that is not case sensitive in this format?
if (lc($array[$i]) eq "<smile>") {
...
}
or
if ($array[$i] =~ /^<smile>$/i) {
...
}
--Ala
------------------------------
Date: Wed, 14 Jun 2000 11:21:32 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: case sensitive pattern recognition....
Message-Id: <3947B10C.A563064E@texas.net>
law_40@my-deja.com wrote:
>
> I have an if loop....
No you don't.
> if ($array[$i] eq ("<smile>"){
> do process.....
> }
That doesn't compile. Please post your *real* code next time.
> the problem is that <smile> could be <SMILE>, <Smile>, etc....
>
> is there a way to do a check that is not case sensitive in this format?
if (lc($array[$i]) eq '<smile>') {
# whatever
}
perldoc -f lc
- Tom
------------------------------
Date: 14 Jun 2000 18:08:25 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <8i8hmp$4brbr$2@fu-berlin.de>
hi,
law_40@my-deja.com wrote:
> I have an if loop....
> if ($array[$i] eq ("<smile>"){
> do process.....
> }
> the problem is that <smile> could be <SMILE>, <Smile>, etc....
if (lc($array[$i]) eq "<smile>"){
perldoc -f lc
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Wed, 14 Jun 2000 16:55:23 -0400
From: "Zowwie" <apage.net[remove]@usa.net>
Subject: Re: case sensitive pattern recognition....
Message-Id: <skfs9l54is4159@corp.supernews.com>
if ($array[$i] =~ m/\<smile\>/i){
See "bind" operator for additional info.
<law_40@my-deja.com> wrote in message news:8i8a9i$21c$1@nnrp1.deja.com...
> I have an if loop....
>
> if ($array[$i] eq ("<smile>"){
> do process.....
> }
>
> the problem is that <smile> could be <SMILE>, <Smile>, etc....
>
> is there a way to do a check that is not case sensitive in this format?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 21:26:41 GMT
From: Andy <y-o-y@home.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <lMS15.2687$A%3.33564@news1.rdc2.pa.home.com>
In article <8i8aff$24o$1@nnrp1.deja.com>, law_40@hotmail.com wrote:
> I have an if loop....
>
> if ($array[$i] eq ("<smile>"){
> do process.....
> }
>
> the problem is that <smile> could be <SMILE>, <Smile>, etc....
>
> is there a way to do a check that is not case sensitive in this format?
>
Taken with as large a grain of salt as a newbie like me deserves, how
about:
if (uc(substr($array[$i],1,5)) eq "SMILE") {
do 'something...'
}
"A diplomat is a person who can tell you
to 'Go To Hell' in such a way that you
actually look forward to the trip."
--Anonymous
------------------------------
Date: Wed, 14 Jun 2000 14:38:39 -0700
From: Employer <jenniferbNOjeSPAM@oreilly.com.invalid>
Subject: Computer Programmer Profile
Message-Id: <03498430.306eaa2a@usw-ex0104-032.remarq.com>
I am looking for information so that I may create a "profile" for
a computer programmer. I am interested in finding out the
following:
Where do computer programmers "hang out" on the Internet?
What websites do they visit?
What magazines do they generally read?
How old do they tend to be?
Where do they go to search for employment?
I am interested in this information so that I may easily find
computer programmers for employment in the future. The good ones
are hard to find and I am looking for them!!
Thanks for any help.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 14 Jun 2000 14:52:31 -0700
From: Toshi Horie <horie@litho.eecs.berkeley.edu>
Subject: conection speed
Message-Id: <3947FE9F.F9C12AB4@litho.eecs.berkeley.edu>
Hi.
When a user conects to web server through web browser,
how can I know user's internet conection speed ?
Thank you.
------------------------------
Date: Wed, 14 Jun 2000 13:28:35 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: CRONING DELETE OF DIRECTORY
Message-Id: <3947EAF3.91467E8@jpl.nasa.gov>
ould@my-deja.com wrote:
> Subject: CRONING DELETE OF DIRECTORY
Please don't shout in your subject line (or anywhere else).
> I use Windows NT 4.
> I'm wondering for a perl script allowing
> me to delete all contents of some directory
> except 3 (that I precise as file.db, file.js...).
> The directory is named
> "cache" ( D:\users\user_name\netscape\cache)
Here is one way to do that:
#!/usr/bin/perl -w
use strict;
my $dir = 'D:/users/user_name/netscape/cache';
my @save_list = ("$dir/file.db", "$dir/file.js");
for my $file (glob "$dir/*"){
next if grep {$file eq $_} @save_list;
unlink $file;
};
[Hint: you might have been answered faster if you had posted some code
(even if it hadn't worked) along with your requirements. People want to
help you learn more about perl, not provide free contracting work.]
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Wed, 14 Jun 2000 14:38:22 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: CRONING DELETE OF DIRECTORY
Message-Id: <3947FB4E.B46CA125@jpl.nasa.gov>
Jon Ericson wrote:
> #!/usr/bin/perl -w
> use strict;
>
> my $dir = 'D:/users/user_name/netscape/cache';
> my @save_list = ("$dir/file.db", "$dir/file.js");
> for my $file (glob "$dir/*"){
> next if grep {$file eq $_} @save_list;
> unlink $file;
> };
Err.. I just read through perlfaq4 again and which says:
Please do not use
$is_there = grep $_ eq $whatever, @array;
or worse yet
$is_there = grep /$whatever/, @array;
These are slow (checks every element even if the first matches),
inefficient (same reason), and potentially buggy (what if there are
regexp characters in $whatever?).
The advice is to use a hash instead (perldoc -q element).
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Wed, 14 Jun 2000 15:00:18 GMT
From: EnderW <ender29@my-deja.com>
Subject: Re: Diff. between putting & before a subroutine call
Message-Id: <8i86lm$uvs$1@nnrp1.deja.com>
Thanks a lot. I now know that I didnot need & in my perl subroutine.
Must be an olddoc I was reading. Thx
In article <8i35gf$cp3$1@nnrp1.deja.com>,
EnderW <ender29@my-deja.com> wrote:
> Hi,
> I am newbie to Perl. I use it from time to time. I was looking at
> subroutines. I have seen that they guy calls it like &my_sub instead
of
> my_sub(). Is there a diff. between those two forms ? Thanks
>
> --
> Ender Wiggin
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
Ender Wiggin
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 13:36:36 -0500
From: Burton Kent <burton@remove_this.lucent.com>
To: phill@modulus.com.au
Subject: Re: Difficult regex: Update algorithm
Message-Id: <3947D0B4.5C0A5DC7@remove_this.lucent.com>
> >
> > This is perl. Therefore, there should be an elegant way to do this.
>
> I'm afraid you're going to find this response unhelpful :-(
> A better subject line might be "DIFFicult problem", as comparing two
> files has long been recognised as a difficult problem; regexen will, no
> doubt, help, where there is a difference within a line. Where there is a
> mass insertion or deletion of lines, however, you have to deal with how
> long you will attempt to resynchronise the two different files, an Perl
> won't help you their.
>
> Since this is a well known problem, you might be better off looking at
> the sources/algorithms in the various "diff" p.d. implementations to see
> how they have addressed this.
> hth (but doubt it)
> --
> Peter Hill,
Thanks, Peter.
Excellent points, unfortunately.
B
------------------------------
Date: 14 Jun 2000 21:33:08 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Difficult regex: Update algorithm
Message-Id: <961017049.12305@itz.pp.sci.fi>
In article <393FD241.EBDCB234@remove_this.lucent.com>, Burton Kent wrote:
>Any idea for the logic? The unix utility, 'diff' would do it, except it makes
>assumptions about line numbers, which will almost certainly change between
>versions.
What exactly are those assumptions, and would context diffs solve the
problem?
What I think you want is to effectively take a context diff between
the previous "standard" version and the user-annotated version, and
then apply that patch to the new version.
>This is perl. Therefore, there should be an elegant way to do this.
Well, there is Algorithm::Diff, which should let you do anything diff
does, and more. In your case, you might want to use it to generate
special patches containing only additions. This should be a trivial
modification to the included cdiff.pl sample program.
Note that the version of Algorithm::Diff currently on CPAN (0.59) is a
rather naive and inefficient implementation. If this turns out to be
a problem, you could either search the archives of this group for my
patch that at least reduces the memory usage, or ask Ned Konz to send
his improved version to CPAN.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Wed, 14 Jun 2000 17:49:43 +0100
From: "Joe_Broz@transarc.com" <jbroz@transarc.com>
Subject: Re: distributing perl modules, programs
Message-Id: <3947B7A7.183AB714@transarc.com>
Harrison Page wrote:
>
> Hello,
>
> I have a clump of homegrown scripts and modules that performs a useful
> task. The path to Perl and other details (paths to libraries, preferred
> temporary directory, etc.) are hard-coded across the files. What is the
> best way to distribute these and have the user go through a
> configuration process where I would prompt them (or find) their perl,
> their CGI directories, their library paths. Typically is Perl software
> distributed with a Makefile.PL and I would roll my own scripts here?
>
There are tools to help you build and distribute your modules. See
man perlmodlib (and others)
Hall's "Effective perl programming" discusses this as does
"The Perl Cookbook"
also look at the documents on CPAN or one of the mirrors
------------------------------
Date: Wed, 14 Jun 2000 09:59:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: distributing perl modules, programs
Message-Id: <Pine.GSO.4.10.10006140959010.5301-100000@user2.teleport.com>
On Tue, 13 Jun 2000, Harrison Page wrote:
> Typically is Perl software distributed with a Makefile.PL and I would
> roll my own scripts here?
Yes, and yes, but you should probably consider starting with Makefile.PL,
and see what it can do for you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3356
**************************************