[7313] in Perl-Users-Digest
Perl-Users Digest, Issue: 938 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 28 12:17:24 1997
Date: Thu, 28 Aug 97 09:00:30 -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 Thu, 28 Aug 1997 Volume: 8 Number: 938
Today's topics:
Docu ment contains no data (was :www.perl.com)? <dturley@rocketmail.com>
Re: 'abandon' hope (was: Re: Need help: how to exit a s <clark@s3i.com>
Re: <> operator memory leak? joshu@diku.dk
Re: Assinging values of HASH in to Array <rootbeer@teleport.com>
Bizarre result with regex in -i -pe (Jonathan Feinberg)
Re: Bizarre result with regex in -i -pe (Greg Bacon)
Re: Bizarre result with regex in -i -pe (Michael J Assels)
Bug in perl? Bug in my code? <mark@uunet.ca>
Re: Bug in perl? Bug in my code? (Greg Bacon)
Re: CGI.pm, go to another script and delaying access ti <rootbeer@teleport.com>
Re: Convert to hex <rootbeer@teleport.com>
CPAN sites (was: Need CPAM mirror site URL) (Greg Bacon)
Re: error: Close on unopened file <GEN0> during global <rootbeer@teleport.com>
Re: FTP with perl <buxx@buxx.com>
Re: FTP with perl <gbarr@ti.com>
Help with WWW::Robot memory consumption <koos@polder.ubc.kun.nl>
Integers, God, and e (was Re: Bug in perl? Bug in my co (Jonathan Feinberg)
Re: Is there a perl IDE? (Bryan Miller)
module problems gt1535b@prism.gatech.edu
Need CPAM mirror site URL (Mick Ghazey)
Re: Need help finding/making a cgi script <rootbeer@teleport.com>
newbie: mutidimensional hash -> db ??? <schludi@syscomp.de>
Re: newbie: mutidimensional hash -> db ??? <fawcett@nynexst.com.spam-me-not>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 Aug 1997 10:36:34 -0600
From: David Turley <dturley@rocketmail.com>
Subject: Docu ment contains no data (was :www.perl.com)?
Message-Id: <872782530.22619@dejanews.com>
Well, www.perl.com was back, now its gone again. I found a post from a
day
or two ago mentioning this so i gues I'm not the only one. I look
forward
to the site being fixed.
This site would probably make a good PR and reference site for
promoting
perl. But I noticed in the brief period it was up yesterday that there
is
no contact person given. Sending email to the only name mentioned
generates a "I'm too busy to answer your mail so don't bother me" auto
reply.
As for my question about the meaning of the "document contains no data
error" I received 2 responses. The first said it was because MY page
had
no title tags (???), (it does). The second reply said 'it means what
it
says". Well, I understand English thank you. I was more interested in
what
causes it. I did some experimenting with my server last night and now
see
what/how it is caused. (Who said posting to a newsgroup was helpful?)
later days,
david
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 28 Aug 1997 09:51:40 -0400
From: Clark Dorman <clark@s3i.com>
Subject: Re: 'abandon' hope (was: Re: Need help: how to exit a sub)
Message-Id: <du3gah0ur.fsf@s3i.com>
abigail@fnx.com (Abigail) writes:
> Tom Phoenix (rootbeer@teleport.com) wrote on 1457 September 1993 in
> <URL: news:<Pine.GSO.3.96.970827073556.1757G-100000@julie.teleport.com>>:
> ++
> ++ Hmmm....
> ++
> ++ sub abandon {
> ++ goto sub { warn shift; return }
> ++ }
> ++
> ++ This is getting scary. :-)
>
>
> sub abandon {'warn "' . shift . '"; return';}
>
> open FILE, $file or eval abandon "couldn't open file '$file': $!";
No, this does not work. First, we get a problem with the shift, so we can
put in @_. Second, the warning occurs in abandon, not in the subroutine.
Third, the return doesn't occur.
#!/home/dorman/bin/perl -w
$|++;
print "Going to try abandon \n";
&tryabandon();
print "Back from try abandon \n";
exit(0);
sub abandon { 'warn "' . shift(@_) . '"; return;' }
sub tryabandon {
$file = 'asfd';
open FILE, $file or
eval abandon "couldn't open file '$file': $!";
print " Still in tryabandon! \n";
close FILE;
}
Produces:
elmo:newnew (9:36am) 120% tryab.pl
Going to try abandon
couldn't open file 'asfd' : No such file or directory at (eval 1) line 1.
Still in tryabandon!
Back from try abandon
elmo:newnew (9:36am) 121%
--
Clark Dorman "Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html -Francis Crick
------------------------------
Date: Thu, 28 Aug 1997 10:12:23 -0600
From: joshu@diku.dk
To: joshu@diku.dk
Subject: Re: <> operator memory leak?
Message-Id: <872780713.20469@dejanews.com>
In article <esqk9h78ata.fsf@nortel.ca>,
daku@nortel.ca (Mark Daku) wrote:
>
> joshu@diku.dk (Gargle Zndflxtzyh) writes:
> > But then another program that didnt use the database
> > exhibited the same problem...And after staring at my
> > code for hours to find circular references or hashes
> > that aren't deleted properly and so forth I've found
> > that this short code snippet can use up all my RAM
> > in quite a short while
> > (and Im working on an SGI IRIX machine with 128 megs of RAM):
> >
> > =====================================
> > #!/usr/bin/perl
> >
> > $ROOT = "/usr/local/data/";
> >
> > for (;;) {
> > opendir DIR,$ROOT;
> > for (readdir DIR) {
> > open (FIL,$ROOT.$_);
> > while (<FIL>) {
> > }
> > close FIL;
> > }
> > closedir DIR;
> > }
> > =====================================
> >
>
> No leak on my system:
> ---------------------------------------------------------------------------
> Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
[system info deleted]
try this one then:
===========================================
#!/usr/bin/perl
#!/usr/local/store/bin/perl -w
@dir = ("test.txt");
# I just need a big array of filenames..
for (1..17) {
push @dir,@dir;
}
for (@dir) {
open (FILE,$_);
while (<FILE>) {
}
close FILE;
}
=======================================
try the above in a directory containing a file called "test.txt".
Apparently what happens is that
each time around the "for (@dir)" loop
$_ is an alias for an element in the @dir array, and
when "while (<FILE>)" is executed what really happens
is "while (defined($_ = <FILE>))", but it is the same $_,
so each element in @dir is overwritten by the last chunk
to be read from the <FILE>.
That can get rather big. I thought that $_ would be
auto-localized (as tom c. puts it) but apparently that
only happens with map, grep and foreach..at least
not in while(<FILE>) constructs..
thanks to everyone who responded ..
-Anders Nielsen
Computer Science/Philosophy Student.
Working perl-programmer.
email: joshu@diku.dk
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 28 Aug 1997 08:19:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: William Warner <billw@airone.claircom.com>
Subject: Re: Assinging values of HASH in to Array
Message-Id: <Pine.GSO.3.96.970828081803.8579P-100000@julie.teleport.com>
On Wed, 27 Aug 1997, William Warner wrote:
> By the way, is there a module that would allow the application to
> determine the order of keys in a hash?
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq4/
How_can_I_always_kep_my_hash_so.html
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Aug 1997 15:08:11 GMT
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Bizarre result with regex in -i -pe
Message-Id: <5u448r$lli$1@gte2.gte.net>
I do a lot of one liners in my data-massaging efforts. I have a tab-delimited
file, in which some lines had data in the last field of each line that I
wanted to remove:
perl -i.bak -pe 's/[^\t]+$//'
Yes? No. This results in all of the newlines being stripped (leaving one
rather long line in the file). It's as if the output record separator was set
to null. Is there some obvious, goofy error I'm making? Is perl matching the
$ marker and substituting it out? I could swear it doesn't usually do that.
I was able to do the same substitution in vi with the intended result.
I'm using 5.003 on a Linux box.
--
Jonathan Feinberg jdf@pobox.com Sunny Manhattan, NY
------------------------------
Date: 28 Aug 1997 15:41:48 GMT
From: gbacon@adtran.com (Greg Bacon)
To: jdf@pobox.com
Subject: Re: Bizarre result with regex in -i -pe
Message-Id: <5u467s$241$6@info.uah.edu>
[Posted and mailed]
In article <5u448r$lli$1@gte2.gte.net>,
jdf@pobox.com (Jonathan Feinberg) writes:
: I do a lot of one liners in my data-massaging efforts. I have a tab-delimited
: file, in which some lines had data in the last field of each line that I
: wanted to remove:
:
: perl -i.bak -pe 's/[^\t]+$//'
:
: Yes? No. This results in all of the newlines being stripped (leaving one
: rather long line in the file).
Let's translate your subsitution into English:
Remove runs of non-TAB characters at the end of the line.
I think you mean
% perl -pi.bak -e 's/\t+$//'
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 28 Aug 1997 15:48:38 GMT
From: mjassels@cs.concordia.ca (Michael J Assels)
Subject: Re: Bizarre result with regex in -i -pe
Message-Id: <5u46km$odp$1@newsflash.concordia.ca>
In article <5u448r$lli$1@gte2.gte.net>,
Jonathan Feinberg <jdf@pobox.com> wrote:
>I do a lot of one liners in my data-massaging efforts. I have a tab-delimited
>file, in which some lines had data in the last field of each line that I
>wanted to remove:
>
>perl -i.bak -pe 's/[^\t]+$//'
>
>Yes? No. This results in all of the newlines being stripped (leaving one
>rather long line in the file). It's as if the output record separator was set
>to null. Is there some obvious, goofy error I'm making? Is perl matching the
>$ marker and substituting it out? I could swear it doesn't usually do that.
>I was able to do the same substitution in vi with the intended result.
A newline is not a tab, so it's gobbled up by [^\t]+. There's a long way
to fix this, and a short way, too.
Long:
perl -i.bak -pe 's/[^\t\n]+$//'
Short:
perl -i.bak -ple 's/[^\t]+$//'
Michael
--
$@='@'^'@';$_='!'&~'"';$/='"'&~'!';$^='$'&~'!';$,='*'&~'"';$:='$'&'"';$~='?'^
'/';$;='@';$_="$@$_$/$^$@$_$_$@$_$@$_$_$@$@$_$_$_$@$@$_$^$^$@$@$_"|"$~$^$~$,".
"$@$^$^$@$/$^$,$^$@$@$^$,$/$,$_$^$,$,.$@$/"|"$:$:$:$:$@$,$:$@$^$:$:$:$@$/$,$:".
"$:$:$:$:$:$~\@$/$^"|"$;$;$;$;$:$:$;$:$:$;$;$;$:$:$;$;$;$;$;$;$;$;$@$:$:";`$_`
------------------------------
Date: Thu, 28 Aug 1997 10:36:16 -0400
From: Mark Buckaway <mark@uunet.ca>
Subject: Bug in perl? Bug in my code?
Message-Id: <34058CE0.7E5AB269@uunet.ca>
I have a smart money crunching app. It calcuates taxes and such and,
since I can't find a better way, use printf's to round everything off to
2 decimal places. In one file it saves the info to, the numbers are
required without a decimal place. I've found that perl's printf seem to
take off .01 from a integer randomly in the following code:
$num=sprintf("%.02f",$num);
printf("%d",$num*100);
Say the number is 209.90 in $num after the "rounding". The second line
occationally will print out: 20989. It would seem perl internally thinks
$num is a float and goofs in the multiplication and integer conversion.
If I change the code to print as a string (%s) it works (although, it's
not really what I mean). This problem drives bean counters nuts.
We are using Perl 5.002. Bug in perl? Bug in my code? Anyone know of a
package with the ability to force perl to work in 2 decimal places?
Thoughts?
Mark
--
-----------------------------------------------------------------------
Mark Buckaway mark@uunet.ca +1 888 UUNET OK
Software Programmer Systems Group +1 416 216 5146
UUNET Canada Inc. Internet Services
-----------------------------------------------------------------------
------------------------------
Date: 28 Aug 1997 15:22:19 GMT
From: gbacon@adtran.com (Greg Bacon)
To: Mark Buckaway <mark@uunet.ca>
Subject: Re: Bug in perl? Bug in my code?
Message-Id: <5u453b$241$4@info.uah.edu>
In article <34058CE0.7E5AB269@uunet.ca>,
Mark Buckaway <mark@uunet.ca> writes:
: I have a smart money crunching app. It calcuates taxes and such and,
: since I can't find a better way, use printf's to round everything off to
: 2 decimal places. In one file it saves the info to, the numbers are
: required without a decimal place. I've found that perl's printf seem to
: take off .01 from a integer randomly in the following code:
:
: $num=sprintf("%.02f",$num);
: printf("%d",$num*100);
:
: Say the number is 209.90 in $num after the "rounding". The second line
: occationally will print out: 20989. It would seem perl internally thinks
: $num is a float and goofs in the multiplication and integer conversion.
: If I change the code to print as a string (%s) it works (although, it's
: not really what I mean). This problem drives bean counters nuts.
Tom C. once wrote "God created the integers. All else is the work of
man." If you wish to work around man's imperfections, you could create
a "complex" money class that has an integer for dollars and an integer
for cents. You'll probably want to overload a few operators too. Have
a look at Math::Complex to get a feel of how to do it.
: We are using Perl 5.002. Bug in perl? Bug in my code? Anyone know of a
: package with the ability to force perl to work in 2 decimal places?
As of version 5.004, the s?printf stuff is internal to perl. There may
be a bug in your system's implementation (which is what perl used until
version 5.004). There are also many bona fide security problems with
older perls, so upgrade! upgrade! upgrade! :-)
: Thoughts?
People tend to be very particular about their money, and trying to work
with the infinitude of real numbers on a finite, discrete computer is
bound to be error-prone. Oh, and help save the world by sharing your
code so the world doesn't have to reinvent it. :-)
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Thu, 28 Aug 1997 08:37:44 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "rocker..." <guitarplayer@hotmail.com>
Subject: Re: CGI.pm, go to another script and delaying access times...
Message-Id: <Pine.GSO.3.96.970828082907.8579S-100000@julie.teleport.com>
On Wed, 27 Aug 1997, rocker... wrote:
> I switched from cgi-lib.pl to using the CGI.pm, and I like it, but as
> I'm re-writing and modifying the perl scipts, I'm running into simple
> problems that I can't seem to find the answers for! Is there anywhere
> that has infomation on this?
Have you read the (amazingly extensive) docs which come with CGI.pm? If
so, post your specific questions here.
> How (I seriously can't find this info anywhere) can I simply make a
> script go to another script..
If you mean a CGI script, then you probably want LWP, from CPAN.
> Is there a code or module can I use to put a delay in my script? Like a
> chat script I have, I need to have it so it only allows an indivildual
> to hit update or chat, etc. once every 10 seconds or so.. just a delay
> so idiots can't keep hitting chat every second when they get impatient
> and spawn a million proccesses on my server that will kill my CPU!
Keep a list (in a file) of every person who has triggered the script in
the past ten seconds, and their "next time" (which is when they are
allowed to trigger the script next). If they're trying too soon, send them
a warning page, and add ten seconds to their "next time". If they persist,
add one or two minutes to their "next time", and send them a warning page
saying so. I think you could use the methods in Randal's fourth Web
Techniques column, which explains how to use flock() to avoid problems
when multiple processes need to modify one file. Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 28 Aug 1997 08:42:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dave Schenet <shodan@shodan.erols.com>
Subject: Re: Convert to hex
Message-Id: <Pine.GSO.3.96.970828083944.8579T-100000@julie.teleport.com>
On 28 Aug 1997, Dave Schenet wrote:
> I have a script that will pass some data to a CGI script, and some of
> the values need to be escaped, as they might consist of !@#$%^& etc.
>
> I looked through the FAQ, and there is a module available, however, it
> appears to skip over /?&= and maybe some others, as those are "reserved"
> for URLs... I need to escape ALL non alphanumeric characters.
There's a module on CPAN which will do that. Or it will merely encode the
ones required by the standard. :-) Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Aug 1997 15:36:31 GMT
From: gbacon@adtran.com (Greg Bacon)
Subject: CPAN sites (was: Need CPAM mirror site URL)
Message-Id: <5u45tv$241$5@info.uah.edu>
[Posted and mailed]
In article <3405924f.4836750@news.nac.net>,
mick@DONTSMAM.ME (Mick Ghazey) writes:
: Can't connect to www.perl.com. Does anybody know a CPAN mirror site?
I know several. :-)
: Please respond to this group or substitute domain lowdown.com for nospam.me.
Grrr... friggin header mungers. :-(
Everyone: please, please, please stop berating Tom and posting to clpm
about the www.perl.com problems. THERE IS NOTHING HE CAN DO ABOUT IT!!
He doesn't have root access to the machine, so he can't fix the
problem (nor attend to them when they occur). I assure you, he's as
upset about the recent problems as the rest of us.
For everyone's benefit, here's $CPAN/SITES:
--- 8< ---
CPAN/SITES
Welcome to the CPAN, the Comprehensive Perl Archive Network.
This document describes the CPAN itself, the Network.
---
Network
The master CPAN site is at FUNET, the Finnish University NETwork
(Finland, Europe). Select the site nearest to you from the list below,
'Registered CPAN sites', to get the best response time and bandwidth.
NOTE: one way to select 'the nearest' is to use the
http://www.perl.com/CPAN
which tries to guess the nearest site for you based on your host's
Internet domain name.
The list of the registered CPAN sites follows.
Please note that the sorting order is alphabetical on fields:
continent - country/state - ftp-url
and thus the North American servers happen to be listed between the
European and the South American sites.
Registered CPAN sites
Africa
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Asia
Hong Kong ftp://ftp.hkstar.com/pub/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
Singapore ftp://ftp.nus.edu.sg/pub/unix/perl/CPAN/
South Korea ftp://ftp.bora.net/pub/CPAN/
ftp://ftp.nuri.net/pub/CPAN/
Taiwan ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
ftp://ftp.wownet.net/pub2/PERL/
Thailand ftp://ftp.riubon.ac.th/pub/mirrors/perl/CPAN/
Australasia
Australia ftp://ftp.motd.com/pub/CPAN/
ftp://ftp.netinfo.com.au/pub/perl/CPAN/
New Zealand ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/
Central America
Costa Rica ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/
Europe
Austria ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
Belgium ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
Czech Republic ftp://ftp.fi.muni.cz/pub/perl/
ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
Denmark ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
Estonia ftp://ftp.ut.ee/pub/languages/perl/CPAN/
Finland ftp://ftp.funet.fi/pub/languages/perl/CPAN/
France ftp://ftp.lip6.fr/pub/perl/CPAN/
ftp://ftp.oleane.net/pub/mirrors/CPAN/
ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
Germany ftp://ftp.Germany.EU.net/pub/programming/perl/CPAN/
ftp://ftp.gmd.de/packages/CPAN/
ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
Greece ftp://ftp.ntua.gr/pub/lang/perl/
Hungary ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
Ireland ftp://sunsite.compapp.dcu.ie/pub/perl/
Italy ftp://cis.utovrm.it/CPAN/
the Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
ftp://ftp.EU.net/packages/cpan/
Norway ftp://ftp.uit.no/pub/languages/perl/cpan/
Poland ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
ftp://sunsite.icm.edu.pl/pub/CPAN/
Portugal ftp://ftp.ci.uminho.pt/pub/lang/perl/
ftp://ftp.telepac.pt/pub/CPAN/
Romania ftp://ftp.dntis.ro/pub/mirrors/perl-cpan/
ftp://ftp.dnttm.ro/pub/CPAN/
Russia ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
Slovenia ftp://ftp.arnes.si/software/perl/CPAN/
Spain ftp://ftp.etse.urv.es/pub/mirror/perl/
ftp://ftp.rediris.es/mirror/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
UK ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
ftp://ftp.flirble.org/pub/languages/perl/CPAN/
ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/
North America
California ftp://ftp.cdrom.com/pub/perl/CPAN/
ftp://ftp.digital.com/pub/plan/perl/CPAN/
Calisota http://www.perl.org/CPAN/
Colorado ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
Florida ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
Illinois ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
Manitoba ftp://theory.uwinnipeg.ca/pub/CPAN/
Massachusetts ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
New York ftp://ftp.rge.com/pub/languages/perl/
North Carolina ftp://ftp.duke.edu/pub/perl/
Oklahoma ftp://ftp.ou.edu/mirrors/CPAN/
Ontario ftp://enterprise.ic.gc.ca/pub/perl/CPAN/
ftp://ftp.utilis.com/public/CPAN/
Oregon ftp://ftp.orst.edu/pub/packages/CPAN/
Pennsylvania ftp://ftp.epix.net/pub/languages/perl/
Texas ftp://ftp.metronet.com/pub/perl/
ftp://ftp.sedl.org/pub/mirrors/CPAN/
ftp://ftp.sterling.com/CPAN/
Washington ftp://ftp.spu.edu/pub/CPAN/
South America
Brazil ftp://cpan.if.usp.br/pub/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/
Feedback
You can send email
to the CPAN administrators, cpan@perl.org.
How You Can Help
Inform
If you know of some Perl resources that seem not to be in the CPAN
(you did check the contents listings in indices/, didn't you?) please tell us. We will grab it (if it is small and/or stable) or set up regular mirroring
(if it is not).
Contribute
If you have some modules/scripts/documentation yourself that you
would like to contribute to CPAN, please read the file modules/04pause
and let us know.
Register
If you have a reliable and well-connected ftp site where you can
keep CPAN (about 260 MB currently), more mirror sites are welcome.
Feel free to volunteer and contact the CPAN
administrators describing your mirroring setup, please see the top
of the file MIRRORED.BY Of course, first
check (see from the above list) whether you
area (network-connectivity-and-bandwidth-wise) is already well
covered. Redundancy and fault-tolerance are good things for ftp
archives like CPAN but virtues can be exaggerated. Mirroring
software is available
from the CPAN itself.
Private/Local Mirroring
If you want to set up a private/local mirror of CPAN but
do not want to advertise it you do not need to contact the CPAN
admistrators. You need to assess which of the public CPAN
sites would give the best ftp bandwidth for you (during the
nighttime, mind) and then contact the email address dst_contact
given in the MIRRORED.BY file to learn the best time of the
day to do your mirror. Mirroring software
is available from the
CPAN itself.
--- 8< ---
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Thu, 28 Aug 1997 08:16:07 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Alan Jones <alanj@ti.com>
Subject: Re: error: Close on unopened file <GEN0> during global destruction.
Message-Id: <Pine.GSO.3.96.970828081538.8579O-100000@julie.teleport.com>
On Wed, 27 Aug 1997, Alan Jones wrote:
> It looks like FileHandle.pm does a "close" inside of it's DESTROY
> method. Should it be doing this? What happens if your program has
> to exit AFTER the constructor but BEFORE you can open the file?
Arguably, it's a bug. Run perlbug to report it. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 28 Aug 1997 09:36:01 -0500
From: Buxx <buxx@buxx.com>
Subject: Re: FTP with perl
Message-Id: <34058CD1.160@buxx.com>
Matt Weber wrote:
>
> Is there an easy perl script or module for FTPing something? It needs to be
> able to run on its own....log itslef in....transfer files and close the socket.
> The running on its own part will be done with crontabs. Any suggestions?
>
> M. Weber
> http://weberworld.com
> http://cow.dyn.ml.org/caboose/
use the NET:FTP module (NT ver broke)
------------------------------
Date: Thu, 28 Aug 1997 09:38:10 -0500
From: Graham Barr <gbarr@ti.com>
To: Matt Weber <mweber@vt.edu>
Subject: Re: FTP with perl
Message-Id: <34058D52.44EADBB@ti.com>
Matt Weber wrote:
>
> Is there an easy perl script or module for FTPing something? It needs to be
> able to run on its own....log itslef in....transfer files and close the socket.
> The running on its own part will be done with crontabs. Any suggestions?
There is a module Net::FTP which will give you an API to the
FTP protocol. With a little work on your part you can automate
transfers.
Net::FTP is part of the libnet distribution. You can find this
on CPAN under
modules/by-module/Net/
Normally you could access this via
http://www.perl.com/CPAN/modules/by-module/Net/
but www.perl.com seems to be having an off day.
--
The road to success is lined with many tempting parking spaces.
------------------------------
Date: Thu, 28 Aug 1997 16:06:42 +0200
From: Koos Vriezen <koos@polder.ubc.kun.nl>
Subject: Help with WWW::Robot memory consumption
Message-Id: <340585F2.3E50@polder.ubc.kun.nl>
Hello,
I need some help with this robot script. This script gets all
html/text pages that are accessable from the start url's via
.nl domains. The content of a document is saved in a file.
The code is based on the examples of the man pages.
(I'm using perl 5.004_01 on a NetBSD 1.2.1 i386 box)
#!/usr/bin/perl
require 5.002;
use IO::File;
use WWW::Robot;
@rootDocument = @ARGV;
$robot = new WWW::Robot('NAME' => 'Wanderer',
'VERSION' => 0.001,
'EMAIL' => 'koos@polderland.nl',
'IGNORE_TEXT' => 0,
'TRAVERSAL' => 'breadth');
$robot->addHook('follow-url-test', \&follow_link);
$robot->addHook('invoke-on-contents', \&print_contents);
$robot->addHook('invoke-on-get-error', \&report_error);
$robot->run(@rootDocument);
sub print_contents {
my($robot, $hook, $url, $response, $structure, $filename) = @_;
my($contype) = $response->content_type;
if( !( $response->content_type eq 'text/html' ) ) {
$response->content("");
print "not a text/html content\n";
return;
}
*.......save $responce->content in a file
}
sub follow_link {
my($robot, $hook, $url) = @_;
return 0 unless $url->scheme eq 'http';
return 0 if $url =~ /\.(gif|jpg|png|xbm|au|wav|mpg|GIF|JPG|WAV)$/;
return 0 unless $url =~ /\.nl\//;
return 1;
}
sub report_error {
my($robot, $hook_name, $url, $response) = @_;
print "Error in ".$url->abs;
$response->content("");
}
The problem is that the memory usage of perl grows ten times
faster than the contents of the HTML pages I save. When this
script retrieved a total of 3 Mb, perl memory usage is grown
to 30 Mb. This script stores nothing in memory, but directly
in a file.
I tried to reduce the memory consumption by clearing the
content of the HTTP::Response, but this didn't help.
What is wrong??
Cheers,
Koos Vriezen
------------------------------
Date: 28 Aug 1997 15:55:30 GMT
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Integers, God, and e (was Re: Bug in perl? Bug in my code?)
Message-Id: <5u471i$lli$2@gte2.gte.net>
gbacon@adtran.com said...
> Tom C. once wrote "God created the integers. All else is the work of
> man
Hmmm. If you can find some integers whose relationship results in
the value of the electron's QED "rest-mass" constant n, please
let us know. Perhaps there's a Physics::QED module on CPAN...
--
Jonathan Feinberg jdf@pobox.com Sunny Manhattan, NY
------------------------------
Date: 28 Aug 1997 15:00:32 GMT
From: millerb@fc.hp.com (Bryan Miller)
Subject: Re: Is there a perl IDE?
Message-Id: <5u43qg$74k@fcnews.fc.hp.com>
Charlie Stross (charlie@nospam.antipope.mapson.org) wrote:
: Brian Wheeler<bdwheele@indiana.edu> wrote
: (in article <5tevoa$mec$1@dismay.ucs.indiana.edu>):
: >
: > You forgot the "one true editor": emacs. It has a perl mode which
: >indents for you and will flash matching parens/brackets/braces.
: Apropos which: anyone know how to turn indenting off in cperl-mode? I
: HATE HATE HATE having some idiot editor decide how to indent my code
: for me!
If you are using the one true perl mode, cperl-mode, you can
not only toggle it on or off but you can also select various
styles of indentation - all from the menu. Also you can edit
the cperl-mode.el file and get even more flexibility.
Bryan
------------------------------
Date: Thu, 28 Aug 1997 10:36:50 -0600
From: gt1535b@prism.gatech.edu
To: gt1535b@prism.gatech.edu
Subject: module problems
Message-Id: <872781525.21662@dejanews.com>
Can someone please help me out with this module exporting thing?
I'm trying to export some subroutines into my main package so
I don't have to qualify the name of the subroutine every time I
want to use it. I posted earlier on 'perl modules and OOP' and
I still haven't gotten it to work. I've also tried using
BEGIN {} in both the module and the main program with no success.
I got the BEGIN {} advice from this article:
> [A complimentary Cc of this posting was sent to
> Roger Endo <endo@rose.ucsb.edu>.]
>
> [Copied to perl5-porters, since I think it may be not documented.]
>
> In article <524klk$nig@rose.ucsb.edu>,
> Roger Endo <endo@rose.ucsb.edu> wrote:
> > Hi....I am troubleshooting some code and I am hoping someone
> > would be nice enought to help me out. I know it is probably
> > bad programming style, but I have 2 modules that share some
> > subfunctions. Each module uses the other. Thus we have a
> > circular dependency.
>
> If you look into standard Perl modules, you will see that it is quite
> common. I'm not sure it is documented anywhere, but it happens like
> this: the moment module `M' starts to be loaded, it is considered
> "loaded" for the sake of `require M'. This is undone if there is an
> error during loading. However, if M `use's some modules which
> `use' M, it may happen that this modules consider M to be initialized
> already, while it is not.
>
> It is the job of module writer to ensure no conflicts.
>
> Situation:
> >
> >
> > FILE#1:
> > package foo;
> > <export stuff here>
>
> This 'export stuff' (if not in BEGIN{}) will be executed during
> execution-stage. But this:
>
> > use bar;
>
> Is executed before this, during the compilation stage.
>
> >
> > sub func3
> > {
> > ...
> > }
> >
> > sub func4
> > {
> > ...
> > func2();
>
> The compiler did not see this (or executed EXPORT assignment above)
> when it starts processing FILE #2...
>
> > ...
> > }
> >
>
> since it went directly here:
>
> > FILE #2:
> > package bar;
> > <export stuff here>
> > use foo;
>
> The compiler runs foo::import() here, which checks @foo::EXPORT, which
> was not assigned yet. Nothing is exported...
>
> >
> > sub func1
> > {
> > ...
> > ...
> > func3();
>
> So this is considered bar::func3().
>
> > ...
> > ...
> > }
> >
> > sub func2
> > {
> > ...
> > }
>
> The cleanest solution is to put "export stuff" into BEGIN{}, _and
> comment_ why you did it.
>
> Ilya
please help if you can.
thanks,
Daryl
--
<>< Daryl Bowen <><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 28 Aug 1997 15:01:44 GMT
From: mick@DONTSMAM.ME (Mick Ghazey)
Subject: Need CPAM mirror site URL
Message-Id: <3405924f.4836750@news.nac.net>
Can't connect to www.perl.com. Does anybody know a CPAN mirror site?
Please respond to this group or substitute domain lowdown.com for nospam.me.
Mick
------------------------------
Date: Thu, 28 Aug 1997 08:28:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ex|zzp| <zzp@headquarterz.com>
Subject: Re: Need help finding/making a cgi script
Message-Id: <Pine.GSO.3.96.970828082158.8579R-100000@julie.teleport.com>
On Wed, 27 Aug 1997, Ex|zzp| wrote:
> I am a newbie with cgi scripting. I currently have a web page at
> http://www.headquarterz.com for mIRC scripts. How would i be able to
> make a script for the following:
>
> A> So no one can download anything from other ppl's site from mine(ie:
> someone from another mirc have a direct downlink from my page)
What's a ppl? What's a mirc? :-) But I can't think of any effective way
to keep anyone from downloading something from somebody else's site. And
if you don't want something downloaded from your site, don't put it out
for downloading! (I feel that there's more to your question than I've been
able to see.)
> B> How would i make a script so people can upload a script to my
> ftp..but without being able to go in any other dir on my ftp except the
> one i selected?
You can't upload anything to a protocol! :-) But if you want people to be
able to store files in a directory via FTP, see your ftpd's manpage.
Again, I feel that there's more to your question than I've seen. If so,
ask again.
Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 28 Aug 1997 15:26:04 +0200
From: Wolfgang Schludi <schludi@syscomp.de>
Subject: newbie: mutidimensional hash -> db ???
Message-Id: <34057C6C.1EA096E0@syscomp.de>
hi,
I want to store a multidimensional hash in a db-file.
here's my(failed)try:
------------------------------------------------------------------------------
#! /usr/tools/bin/perl -w
use strict;
my %entry;
dbmopen (%entry, "foo", 0644) or die "couldn't open database: $!";
$entry{"xxx"}{"xxx"}{"xxx"} = "xxx";
$entry{"xxx"}{"yyy"}{"xxx"} = "xyx";
$entry{"xxx"}{"xxx"}{"yyy"} = "xxy";
dbmclose (%entry) or die "couldn't close database: $!";
------------------------------------------------------------------------------
perl says:
> Can't use string ("HASH(0x80c8f9c)") as a HASH ref while "strict refs"
> in use at ././y.pl line 10.
what am I doing wrong?
thanks,
Schludi
--
schludi@syscomp.de
------------------------------
Date: 28 Aug 1997 11:04:58 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
Subject: Re: newbie: mutidimensional hash -> db ???
Message-Id: <8j203eqrfp.fsf@nynexst.com.spam-me-not>
Wolfgang Schludi <schludi@syscomp.de> writes:
> I want to store a multidimensional hash in a db-file.
> here's my(failed)try:
>[code deleted]
DB_File only stores strings. See this module in the Perl Modules List:
MLDBM bdpO Transparently store multi-level data in DBM GSAR
-Tom
PS. Maybe this question should be added to the FAQ list?
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 938
*************************************