[12235] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5835 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 30 16:07:13 1999

Date: Sun, 30 May 99 13:00:17 -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           Sun, 30 May 1999     Volume: 8 Number: 5835

Today's topics:
    Re: /usr/bin/perl vs /usr/local/bin/perl (Kai Henningsen)
    Re: cont'd (Kai Henningsen)
        Couple of basic questions from newbie marshal@marshal.co.uk
    Re: Couple of basic questions from newbie <rootbeer@redcat.com>
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Kai Henningsen)
    Re: How do I sort unique items from a sorted array? <rootbeer@redcat.com>
    Re: Im not asking for much (Kai Henningsen)
        Learning Perl - Random Images <s.mon@worldnet.att.net>
    Re: Learning Perl - Random Images <flavell@mail.cern.ch>
    Re: Learning Perl - Random Images (Dave Cross)
    Re: Learning Perl - Random Images <flavell@mail.cern.ch>
    Re: Learning Perl - Random Images (I R A Aggie)
    Re: London.pm Meeting (Dave Cross)
    Re: package OO::Closures (was Re: In favor of extending (Abigail)
        perl.h/xs error in rpm version of perl 5.005_03 (Callie Greenfield)
    Re: REMOTE_USER - How come I can't see it? <flavell@mail.cern.ch>
    Re: REMOTE_USER - How come I can't see it? (ace)
        Salvaging CPAN installs after Perl upgrade? <ljz@asfast.com>
    Re: Slow, or looping? (Ronald J Kimball)
    Re: Web based Username/Password creation module <rootbeer@redcat.com>
    Re: Y2K.  localtime(time) (Abigail)
    Re: Y2K.  localtime(time) <dgris@moiraine.dimensional.com>
    Re: Y2K.  localtime(time) <uri@sysarch.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 30 May 1999 18:28:00 +0200
From: kaih=7Hpl17-Xw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: /usr/bin/perl vs /usr/local/bin/perl
Message-Id: <7Hpl17-Xw-B@khms.westfalen.de>

dragons@dragons.duesouth.net (Matthew Bafford)  wrote on 15.05.99 in <slrn7jpilt.u4.dragons@dragons.duesouth.net>:

> perl -i -pe 's{^#!/usr/bin/perl}{#!/usr/local/bin/perl}' *.plx
>
> Just the backslashing that you'd have to do in sed is enough to use Perl
> instead. :-)

What backslashing? You *do* know that sed doesn't insist on using /,  
right?


Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


------------------------------

Date: 30 May 1999 18:23:00 +0200
From: kaih=7Hpl0whmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: cont'd
Message-Id: <7Hpl0whmw-B@khms.westfalen.de>

rjk@linguist.dartmouth.edu (Ronald J Kimball)  wrote on 29.05.99 in <1dskhyx.cqadcts9g3mgN@p59.tc2.metro.ma.tiac.com>:

> Uri Guttman <uri@sysarch.com> wrote:
>
> > look, several people have responded to you and we still don't understand
> > your problem. you can embed newlines directly in single quoted
> > strings. you can't interpolate \n into a single quoted string. so what
> > are you actually trying to do? you show output you want but no data so
> > how could we divine what you have?
>
> I hate to say this, Uri (no, actually, I don't :) but I understood
> perfectly the question as asked in the original post.  The poster wants
> to know the best ways to print newlines in various types of quoted
> strings.

Well, I'm not so sure I understood it, but mostly that is because what I  
*think* he(?) wants doesn't make very much sense. Sorry, let me rephrase  
that: it doesn't make any sense at all. It looks like a pretty pointless  
exercise - a little like "given a potato and red paint, can I make it look  
like a cherry?" Sure, you can - but why on earth would you want to?

> Frankly, if you do not understand a poster's question, I would suggest
> that it is more appropriate to wait and see if someone else understands,
> rather than repeatedly harassing the poster.

Well, given later messages from the same poster, I'm forced to conclude  
that Uri may well have displayed accurate judgement there. "Thick" sure  
seems to be an euphemism applied to this guy (as in, "the answer is right  
in what you were reading" not even generating a "huh?", let alone the  
"duh" it should have).


Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


------------------------------

Date: Sun, 30 May 1999 18:54:17 GMT
From: marshal@marshal.co.uk
Subject: Couple of basic questions from newbie
Message-Id: <375185b3.3132021@fleece.argonet.co.uk>

OK - just starting and this will be a long row to hoe. One specific
and one general question.

1) I note that the perl print statment (command? Method?) hates having
double quotes in it - so far I have always had to remove them to make
the script work. BUT HTML tags often require attributes in quotes. Is
the solution an escape character of some sort or something I've
missed?

2) Can I use perl to create, open, write to, up-date and delete files
on the server? No need for explaination of how - just that the product
I'm aiming at will need that (or some other solution) and I want to
know if I'm barking up the right tree.

Marshal

www.marshal.co.uk 


------------------------------

Date: Sun, 30 May 1999 12:48:49 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Couple of basic questions from newbie
Message-Id: <Pine.GSO.4.02A.9905301238280.20230-100000@user2.teleport.com>

On Sun, 30 May 1999 marshal@marshal.co.uk wrote:

> 1) I note that the perl print statment (command? Method?) 

Function? Operator? :-)

> hates having double quotes in it -

No, you're just unable to write "A double quoted string with "inernal"
quote marks" because perl has no way to know that some are just
punctuation and some really end the quoted string. One way is to put a
backslash in front of the quote mark:

    print "I said, \"This is how to do it!\"\n";

Another way is to use "generalized" quote marks. These look like qq// or
qq() or qq{}, and let you choose the punctuation mark to use, so long as
you use the corresponding one to finish the quote. Of course, you should
choose something you won't be needing to use within the string, or you'll
need to backwhack _that_ character!

    print qq{I say, "This is better yet", don't you agree?\n};

Yet another way (TIMTOWTDI) is to use a here-document. 

    print <<"END";
    This is the better way when many lines are to be printed,
    but it's important to make sure that the end tag ("END") is
    on a line all by itself, with no whitespace before or after.
    In this example it is, but you have to remember that I've
    indented the example to make it stand out from the rest of my
    message - if you use this as-is, it won't work.
    END

See the perldata manpage for more information on all of these.

> 2) Can I use perl to create, open, write to, up-date and delete files
> on the server? 

Yes, certainly, Perl can do that. Your server and system (and sysadmin)
must permit that, of course. But it's hard to find a typical programming
task which can't be done in Perl (for appropriate values of "typical"). 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 30 May 1999 18:48:00 +0200
From: kaih=7Hpl1yuXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K complian
Message-Id: <7Hpl1yuXw-B@khms.westfalen.de>

finsol@ts.co.nz  wrote on 27.05.99 in <7iilcm$1dl$1@nnrp1.deja.com>:

> We computer people

Don't insult us by claiming we are like you.

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


------------------------------

Date: Sun, 30 May 1999 12:22:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How do I sort unique items from a sorted array?
Message-Id: <Pine.GSO.4.02A.9905301141320.18009-100000@user2.teleport.com>

On Sun, 30 May 1999, AEF wrote:

> I have looked at that, and it extracts the unique items, but will only
> show the last value the hash has seen, which isn't necessarily the
> highest paid unique category, so the ability to sort the unique item
> is lost.

I guess I'm (still) confused about what you want. Do you want a two-level
sort? I'm appending some code that may or may not do something like you're
needing. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/

#!/usr/bin/perl -w

use strict;

my @data = (
	# Occupation, category, salary
	[ 'TV News Anchor', 'white collar', 300000 ],
	[ 'US President', 'politics', 200000 ],
	[ 'Cat waxer', 'nonexistant', 10000 ],
	[ 'Stand-in for Jake Lloyd', 'white collar', 30000 ],
	[ 'Special effects tech', 'blue collar', 30000 ],
	[ 'Microsoft quality control', 'nonexistant', 8000 ],
	[ 'Presidential intern', 'politics', 45000 ],
	[ 'Perl mentor', 'white collar', 250000 ],
	[ 'Backstreet Boy', 'white collar', 250000 ],
	[ 'Bodyguard for Backstreet Boy', 'blue collar', 45000 ],
	[ 'Easter Bunny', 'nonexistant', 25000 ],
	[ 'Road-stripe painter', 'blue collar', 40000 ],
	[ 'Mayor McCheese', 'politics', 65000 ],
);

# Sort by category. Within category, by salary. Sort categories in
# order of the highest salary among them.
{
    # Keep track of the highest salary seen in each category
    my %highest;
    for (@data) {
	my($occ, $cat, $sal) = @$_;
	# What was the highest seen so far?
	my $was = $highest{$cat} || 0;
	next if $was >= $sal;
	$highest{$cat} = $sal;
    }

    @data = sort {
	# By category, according to salary
	$highest{$b->[1]} <=> $highest{$a->[1]} or
	# By salary itself
	$b->[2] <=> $a->[2] or
	# Last resort, alpha by occupation
	$a->[0] cmp $b->[0]
    } @data;
}

{
    my $prev = "This ain't a category nohow";
    for (@data) {
	my($occ, $cat, $sal) = @$_;
	if ($cat ne $prev) {
	    # New category
	    print "\nCategory: $cat\n";
	    $prev = $cat;
	}
	printf "\t%-35s %10s\n", $occ, $sal;
    }

    print "\n\n";
}

__END__



------------------------------

Date: 30 May 1999 18:10:00 +0200
From: kaih=7Hpl0$FXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Im not asking for much
Message-Id: <7Hpl0$FXw-B@khms.westfalen.de>

abigail@delanet.com (Abigail)  wrote on 29.05.99 in <slrn7l10p5.7ub.abigail@alexandra.delanet.com>:

> %% a) a programmer wanting to learn perl

> %%    print "Learning Perl by Randal Schwartz\n";
>
> That would be "Randal Schwartz and Tom Christiansen".
>
> However, I would recommend "Perl: The Programmers Companion" instead.
> More useful for people who can already program, IMO.

"Programming Perl (2nd Edition)" did just fine for me.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


------------------------------

Date: Sun, 30 May 1999 12:16:08 -0400
From: "Steven Mon" <s.mon@worldnet.att.net>
Subject: Learning Perl - Random Images
Message-Id: <7iro0n$e6d$1@bgtnsc01.worldnet.att.net>

I'm just starting to learn Perl (it's pretty fun).  I've got a Linux box and
have been trying out simple scripts.  I wrote one to pull random images - it
was a round about way (basically I put it a the cron file and it would copy
over a random file in a directory).

I then saw on Matt's Script Archive where he put in the line in his perl
script

print "Location: $picdirectory$picfile";

so that it loads a new image whenever a person visits the site, which seems
to be a lot better way to do it than what I was doing.  But what is this
*Location* thing?  I couldn't find it in my Perl books.  Is it some kind of
HTML thing?  I've never heard of it...!

Thanks!

--
Steven Mon




------------------------------

Date: Sun, 30 May 1999 18:28:00 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Learning Perl - Random Images
Message-Id: <Pine.HPP.3.95a.990530182308.8487H-100000@hpplus01.cern.ch>

On Sun, 30 May 1999, Steven Mon wrote:

> I then saw on Matt's Script Archive where he put in the line in his perl
> script
> 
> print "Location: $picdirectory$picfile";
> 
> so that it loads a new image whenever a person visits the site, which seems
> to be a lot better way to do it than what I was doing.  But what is this
> *Location* thing? 

It's a CGI response, and the proper place to discuss it would be the
comp.infosystems.www.authoring.cgi group, after checking its FAQ of
course.

> I couldn't find it in my Perl books.

It's not a Perl language issue.  You can create CGI responses with a
shell script, or a compiled COBOL program, or whatever.  With any
language that can support the Common Gateway Interface, in fact.

-- 

          The British attitude is essentially that it is better to have 
          100% of nothing than 25% of something. - D.Hansen, uk.railway




------------------------------

Date: Sun, 30 May 1999 16:58:40 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Learning Perl - Random Images
Message-Id: <37526d0d.22762697@news.demon.co.uk>

On Sun, 30 May 1999 12:16:08 -0400, "Steven Mon"
<s.mon@worldnet.att.net> wrote:

>I'm just starting to learn Perl (it's pretty fun).  I've got a Linux box and
>have been trying out simple scripts.  I wrote one to pull random images - it
>was a round about way (basically I put it a the cron file and it would copy
>over a random file in a directory).
>
>I then saw on Matt's Script Archive where he put in the line in his perl
>script
>
>print "Location: $picdirectory$picfile";
>
>so that it loads a new image whenever a person visits the site, which seems
>to be a lot better way to do it than what I was doing.  But what is this
>*Location* thing?  I couldn't find it in my Perl books.  Is it some kind of
>HTML thing?  I've never heard of it...!

Congratualtions. You may be the first person to learn something useful
from one of Matt's scripts. In general they should be avoided at all
costs.

'Location' is an http header which tells the browser to request the
file in the location header and display that instead of the originally
requested file. You can find out more about this stuff i nthe
approprate newsgroup (one that discusses CGI).

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


------------------------------

Date: Sun, 30 May 1999 19:38:18 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Learning Perl - Random Images
Message-Id: <Pine.HPP.3.95a.990530185740.8487I-100000@hpplus01.cern.ch>

On Sun, 30 May 1999, Dave Cross wrote:

> 'Location' is an http header 

"Location" is indeed the name of an HTTP header, but what normal CGI
scripts write are not HTTP headers, they are CGI responses.

The similarity can be confusing.  In this case especially so, as there
is one kind of Location CGI response that leads to an HTTP Location
header being transmitted, and another kind of Location CGI response that
doesn't.  Even the CGI part of the Perl FAQ seems to be muddled about
this.

> You can find out more about this stuff i nthe
> approprate newsgroup (one that discusses CGI).

Quite so.  And in the traditional documentation of the CGI at
http://hoohoo.ncsa.uiuc.edu/cgi/

There's also some work-in-progress at http://web.golux.com/coar/cgi/

One can see that they're busily rewriting the detailed wording of this
part of the spec, but, as is clear from the "issues list",
http://web.golux.com/coar/cgi/issues.cgi/detail/110 , the rewording was
a result of other considerations - the behaviour of the Location:
response itself was unaffected by these considerations.

all the best



------------------------------

Date: 30 May 1999 19:03:51 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Learning Perl - Random Images
Message-Id: <slrn7l332r.hjm.fl_aggie@thepentagon.com>

On Sun, 30 May 1999 16:58:40 GMT, Dave Cross <dave@dave.org.uk>, in
<37526d0d.22762697@news.demon.co.uk> wrote:

+ On Sun, 30 May 1999 12:16:08 -0400, "Steven Mon"
+ <s.mon@worldnet.att.net> wrote:

+ >I then saw on Matt's Script Archive where he put in the line in his perl
+ >script

+ >print "Location: $picdirectory$picfile";

+ Congratualtions. You may be the first person to learn something useful
+ from one of Matt's scripts. In general they should be avoided at all
+ costs.

That presumes, of course, that $picfile contains a double new-line
sequence at the end...

James


------------------------------

Date: Sun, 30 May 1999 16:41:13 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: London.pm Meeting
Message-Id: <375169e5.21954913@news.demon.co.uk>

On 29 May 1999 20:51:22 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>On Fri, 28 May 1999 06:36:43 GMT Dave Cross wrote:
>> 
>> 1/ The results of Dave, Greg and Dave's "let's think up the stupidest
>> set of rules to a Perl programming competition possible whilst heavily
>> underthe influence of alcohol" competition (assuming, of course, that
>> anyone bothered to enter).
>> 
>
>I didnt understand a word of it so I guess that I can confirm that they
>were indeed 'heavily under the influence of alcohol'.
>
>However any Perl Hacker who lives or works or can be in London on the
>day and who has thus far failed to embarrass themselves in the aforementioned
>venue should come along and feel free to buy me a beer ;-}

Actually, anyone who *has* previously embarrassed themselves in the
aforementioned venue would be made most welcome too.

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


------------------------------

Date: 30 May 1999 11:00:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: package OO::Closures (was Re: In favor of extending "my" to apply to subroutines as well as variables)
Message-Id: <slrn7l2oht.fd2.abigail@alexandra.delanet.com>

Rick Delaney (rick.delaney@home.com) wrote on MMXCVIII September MCMXCIII
in <URL:news:3750A867.3DC4FE03@home.com>:
// [posted & mailed]
// 
// This is quite excellent, but I have a couple of little questions.
// 
// Abigail wrote:
// > 
// >         if ($method =~ /^([^:]+|:[^:])*::(.*)/s) {
//                                   ^^^^^
// >             $class  = $1;
// >             $method = $2;
// >         }
// 
// What kind of method name is this for?

It allows for class names with a ':' in them. 

// Why this song-and-dance?  Is there some case where 
// 
//         foreach my $super (@supers) {
//             return eval { $super -> ($method => @args) } unless $@;
//             croak $@ unless $@ =~ /No such method/;
//         }
// 
// would not produce the desired results?

You're probably right that this will work as well.




Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== 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: Sun, 30 May 1999 18:59:35 GMT
From: madebeer@debeer.org (Callie Greenfield)
Subject: perl.h/xs error in rpm version of perl 5.005_03
Message-Id: <rUf43.4533$kd5.500428@typhoon-sf.snfc21.pbi.net>

Hi,

I'm having trouble with the latest rpm version of 
  perl, version 5.005_03 built for i386-linux

I'm using Redhat 5.2.  I hope someone can help me.

The install (rpm -i) of perl showed no errors.  

But when I use the CPAN module to install a module that uses .xs, 
it throws an error, like (reformatted for the screen)

--------------------------
CPAN.pm: Going to build GBARR/IO-1.20.tar.gz
[..]
cc -c  -Dbool=char -DHAS_BOOL -I/usr/local/include -O2    \
       -DVERSION=\"1.20\" -DXS_VERSION=\"1.20\" -fpic \
       -I/usr/lib/perl5/5.00503/i386-linux/CORE -DI_POLL  IO.c

In file included from IO.xs:9:
/usr/lib/perl5/5.00503/i386-linux/CORE/perl.h:2546: \
       redefinition of `union semun'
make: *** [IO.o] Error 1
       /usr/bin/make  -- NOT OK
--------------------------
Things I've tried to narrow the problem:

* I used to be running perl5.004 , and used rpm -U to upgrade it to 5.005 .  
  I thought maybe my upgrade was messy.  So I renamed /usr/lib/perl5 to 
  /usr/lib/perl5- , and removed perl5.005 with rpm -e, 
  then reinstalled perl5.005, but it gave me the same error when adding the 
  IO package.  So I believe this is a perl/perl module issue and not
  an rpm issue.  

* Also, I thought it might be a problem just with the IO package.  So I 
  tried installing several modules that used .xs, such as
  IO and XML::Parser, and got the same error, so I believe this is a basic
  ( perl.h ? ) issue and not a problem only with the IO package.

Scanning hotbot and dejanews, I see at least one other person with a similar
problems, but no solutions.

Thanks in advance for any help,
-Michael de Beer







------------------------------

Date: Sun, 30 May 1999 18:21:28 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: REMOTE_USER - How come I can't see it?
Message-Id: <Pine.HPP.3.95a.990530181620.8487G-100000@hpplus01.cern.ch>

On Sun, 30 May 1999, Charles Pelkey wrote:

> Remote User is only set if the user authenticates with the server...

Of course, but this has nothing to do with the Perl language,
it's a CGI issue, clearly documented in the CGI spec and answered with
monotonous regularity on the appropriate group, and this one isn't it.

Tom's style, if my observations are anything to go by, is to encourage
questioners to think for themselves, not to reward them for posting
questions in irrelevant places by handing them an answer on a silver
salver. Quite right too. 


Oh look, you hung an 8-line sig followed by quoting the entire previous
posting on the end of your f'up. Thanks for the bogosity alerts, but
there are more economical ways of advertising the unreliability of your
usenet responses. 



------------------------------

Date: Sun, 30 May 1999 17:28:06 GMT
From: kawaii_1@hotmail.com (ace)
Subject: Re: REMOTE_USER - How come I can't see it?
Message-Id: <37517475.5026648@news-server>

Who cares what you think? Save your opinions
for your loser chat sessions. At least he replied
with some kind of information. Why don't you
take you lame attitude and save it for when
you mother catches you jerking off
while watching porn because you can't get
a girlfriend with your assinine intellect.
This newsgroup is for anyone with any questions remotely
related to perl. It is not limited to your personal definition.

Asshole.


On Sun, 30 May 1999 18:21:28 +0200, "Alan J. Flavell"
<flavell@mail.cern.ch> wrote:

>On Sun, 30 May 1999, Charles Pelkey wrote:
>
>> Remote User is only set if the user authenticates with the server...
>
>Of course, but this has nothing to do with the Perl language,
>it's a CGI issue, clearly documented in the CGI spec and answered with
>monotonous regularity on the appropriate group, and this one isn't it.
>
>Tom's style, if my observations are anything to go by, is to encourage
>questioners to think for themselves, not to reward them for posting
>questions in irrelevant places by handing them an answer on a silver
>salver. Quite right too. 
>
>
>Oh look, you hung an 8-line sig followed by quoting the entire previous
>posting on the end of your f'up. Thanks for the bogosity alerts, but
>there are more economical ways of advertising the unreliability of your
>usenet responses. 



------------------------------

Date: 30 May 1999 16:54:26 +0000
From: Lloyd Zusman <ljz@asfast.com>
Subject: Salvaging CPAN installs after Perl upgrade?
Message-Id: <ltiu9asdkt.fsf@asfast.com>

I've finally gotten around to upgrading my 5.005_02 version of Perl to
5.005_03, and now I want to install all the modules I got from CPAN
that I so painstakingly installed within my 5.005_02 release.  Due to
the version-specific subdirectories within my Perl library tree, it
looks like I need to re-install all these modules.

I'm willing to do this next time I have an afternoon or two, but I'm
wondering if there is any kind of automated or at least
partially-automated way to rebuild all my previously installed CPAN
modules.  I have a dial-up internet connection and I'd like to
avoid re-downloading everything.

Before any of tell me to write some Perl code to traverse through my
current CPAN files and then issue the proper commands to do all the
necessary builds, please know that I'm quite able to do this, and also
quite willing as a last resort.  Before I do this, however, I'm
wondering if an automated or semi-automated procedure for this already
exists.

Thanks in advance.


-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print $x'


------------------------------

Date: Sun, 30 May 1999 13:03:27 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Slow, or looping?
Message-Id: <1dsmbvr.pv4r4t1w95tdnN@p32.tc2.state.ma.tiac.com>

Kai Henningsen <kaih=7HpeDiPmw-B@khms.westfalen.de> wrote:

> While debugging my Mail-and-News converter, I happened upon the following
> (it's in Mail::Address):
> 
> $_ = '"Kirsten R. Chevalier, R for RIGHTEOUSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"'
> 
> s/(([a-z]+|[a-z]\-[a-z])+)\s*,?\s*(([a-z]\s*\.\s*)+)(\[^\sa-z]|\Z)/$3 $1/io
     ^^^^^^^^^^^^^^^^^^^^^^

Ignoring the second alternative, this is:

([a-z]+)+

which is a classic form for execution in exponential time on the length
of the target string when the regex fails to match.


The use of alternation here also forces an unnecessary backtrack when
the target string contains a hyphen.


Try changing the highlighted part to:

([a-z](-[a-z])?)+

which should solve both problems.


> # change Barr, G. M. => G. M. Barr
> 
> Trying to single-step through that line (under -d) seems to hang. (And
> running without the debugger is already hanging for some hours.)
> 
> Now, is this an endless loop somewhere, or just a *really* slow regex?
> 

I don't believe it is possible to create an endless loop in a regex
(barring execution of arbitrary Perl code with the new regex features).
So, any regex which takes "forever" to finish is just really slow.

HTH!

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: Sun, 30 May 1999 12:33:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Web based Username/Password creation module
Message-Id: <Pine.GSO.4.02A.9905301230180.20230-100000@user2.teleport.com>

On Sun, 30 May 1999, Stan Hearn wrote:

> I'm about to build a web site that will require a username and password.
> 
> I don't want to re-invent the wheel.  

That's great! The software you describe (or something very much like it)
has already been written. Try searching among the various software
archives. Since there's nothing Perl-specific about your request, you
should probably start with web-related archives. But don't miss CPAN's
scripts archive. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 30 May 1999 11:44:30 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Y2K.  localtime(time)
Message-Id: <slrn7l2r4q.fd2.abigail@alexandra.delanet.com>

Hans Xie (hans.xie@its.CSIRO.AU) wrote on MMLXXXII September MCMXCIII in
<URL:news:7hfqbg$fk_001@its.csiro.au>:
^^ Hi,
^^ 
^^ I am in the middle of our Y2K testing.  I am puzzled by the localtime() return 
^^ value.  Out system date is: Sun Jan  2 10:10:51 EST 2000
^^ 
^^ I noticed a strange thing.  I put it in the below script to make the 
^^ situation simple and clear:
^^   #!/usr/local/bin/perl
^^   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
^^   print $year;
^^ 
^^ It prints 100, instead of 2000 or 00.
^^ 
^^ Any idea?  Thanks in advance.
^^ 
^^ environment:
^^ Solaris 2.6, Perl 5.005_02


Do you still have the box of your Sun? If so, please put the computer in
the box and ship it back to your vendor. Tell them you're too stupid to
read manuals and hence you shouldn't be allowed near any computers.



Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== 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: 30 May 1999 11:38:27 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Y2K.  localtime(time)
Message-Id: <m3r9nytq3w.fsf@moiraine.dimensional.com>

abigail@delanet.com (Abigail) writes:

> Do you still have the box of your Sun? If so, please put the computer in
> the box and ship it back to your vendor. Tell them you're too stupid to
> read manuals and hence you shouldn't be allowed near any computers.

Please ignore Abigail.

The obvious, _correct_, solution to your problem is to pack
your machine back into its box and ship it to _me_.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: 30 May 1999 15:36:14 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Y2K.  localtime(time)
Message-Id: <x7pv3ifiz5.fsf@home.sysarch.com>

>>>>> "DG" == Daniel Grisinger <dgris@moiraine.dimensional.com> writes:

  DG> abigail@delanet.com (Abigail) writes:
  >> Do you still have the box of your Sun? If so, please put the computer in
  >> the box and ship it back to your vendor. Tell them you're too stupid to
  >> read manuals and hence you shouldn't be allowed near any computers.

  DG> Please ignore Abigail.

  DG> The obvious, _correct_, solution to your problem is to pack
  DG> your machine back into its box and ship it to _me_.

<aol>
no, send it to me! i know how to fix that bug!
</aol>

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


------------------------------

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 5835
**************************************

home help back first fref pref prev next nref lref last post