[23678] in Perl-Users-Digest
Perl-Users Digest, Issue: 5885 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 3 03:05:59 2003
Date: Wed, 3 Dec 2003 00:05:19 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 3 Dec 2003 Volume: 10 Number: 5885
Today's topics:
Add File Names with Time Stamp <Temp@NoSuchDomain.Info>
Re: Add File Names with Time Stamp <noreply@gunnar.cc>
Re: Add File Names with Time Stamp <Temp@NoSuchDomain.Info>
Re: Add File Names with Time Stamp (Tad McClellan)
Re: Add File Names with Time Stamp <Temp@NoSuchDomain.Info>
Re: Add File Names with Time Stamp <Temp@NoSuchDomain.Info>
Re: Add File Names with Time Stamp <usenet@morrow.me.uk>
Can perl be used to test ISP upload speed? <someone@somewhere.nb.ca>
Re: Can perl be used to test ISP upload speed? <noreply@gunnar.cc>
Re: Don't Read - Testing (Si Ballenger)
Re: Don't Read - Testing <jurgenex@hotmail.com>
Re: Don't Read - Testing <tom@nosleep.net>
Re: Don't Read - Testing <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Don't Read - Testing <tom@nosleep.net>
Re: Generating Day of Week in Pure Perl <me@privacy.net>
multi-threading (Jason Quek)
Re: multi-threading <bigiain@mightymedia.com.au>
Re: net::scp::expect error (Daniel Berger)
Re: Newsgroup Searching Program <gerardlanois@netscape.net>
Re: Newsgroup Searching Program <usenet@morrow.me.uk>
Re: question about installation of GD::Text on cygwin ( (Upstart)
Re: question about installation of GD::Text on cygwin ( <usenet@morrow.me.uk>
Re: s// problem <nospam@nospam.net>
Re: s// problem <tore@aursand.no>
Re: Session Management? <zmonteca@zmonteca.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 03 Dec 2003 04:02:59 GMT
From: "Picker Leon" <Temp@NoSuchDomain.Info>
Subject: Add File Names with Time Stamp
Message-Id: <Tfdzb.143230$Ec1.5775385@bgtnsc05-news.ops.worldnet.att.net>
I have 1000 pictures files from digital camera. I want to rename the files
so that the file will have the time stamp so that I can know where I took
those pictures. If I FTP those files, the time stampe will always change etc
so I must include the time stamp into the filename. Here is what I want PERL
to do:
Dir the directory
Add each file's timestamp to the end of the file name.
Anyone knows a little script to do that work?
------------------------------
Date: Wed, 03 Dec 2003 05:10:17 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Add File Names with Time Stamp
Message-Id: <bqjnnj$1v54a7$1@ID-184292.news.uni-berlin.de>
Picker Leon wrote:
> I have 1000 pictures files from digital camera. I want to rename
> the files so that the file will have the time stamp so that I can
> know where I took those pictures. If I FTP those files, the time
> stampe will always change etc so I must include the time stamp into
> the filename. Here is what I want PERL to do:
>
> Dir the directory Add each file's timestamp to the end of the file
> name.
>
> Anyone knows a little script to do that work?
You can easily write it by help of these Perl functions:
readdir()
stat()
rename()
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 03 Dec 2003 04:21:06 GMT
From: "Picker Leon" <Temp@NoSuchDomain.Info>
Subject: Re: Add File Names with Time Stamp
Message-Id: <Swdzb.143286$Ec1.5778700@bgtnsc05-news.ops.worldnet.att.net>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> ????
news:bqjnnj$1v54a7$1@ID-184292.news.uni-berlin.de...
> Picker Leon wrote:
> > I have 1000 pictures files from digital camera. I want to rename
> > the files so that the file will have the time stamp so that I can
> > know where I took those pictures. If I FTP those files, the time
> > stampe will always change etc so I must include the time stamp into
> > the filename. Here is what I want PERL to do:
> >
> > Dir the directory Add each file's timestamp to the end of the file
> > name.
> >
> > Anyone knows a little script to do that work?
>
> You can easily write it by help of these Perl functions:
>
> readdir()
> stat()
> rename()
>
Could you show me how? I have pictures all in 1 dir with will sit with this
perlscript. All are ending with JPG. Thank you.
------------------------------
Date: Tue, 2 Dec 2003 22:45:07 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Add File Names with Time Stamp
Message-Id: <slrnbsqqij.1vh.tadmc@magna.augustmail.com>
Picker Leon <Temp@NoSuchDomain.Info> wrote:
> Anyone knows a little script to do that work?
This isn't where folks talk about programs written in Perl.
This is where folks talk about _writing_ programs in Perl.
Write a Perl program that does the best you can, post
it here, and we will help you fix it.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 03 Dec 2003 05:14:52 GMT
From: "Picker Leon" <Temp@NoSuchDomain.Info>
Subject: Re: Add File Names with Time Stamp
Message-Id: <gjezb.143453$Ec1.5784007@bgtnsc05-news.ops.worldnet.att.net>
Here is what I wrote. Works 100%. But the only problem is if I have two
files with the same timestamp, it will overwrite it. Can you fix it? If the
rename to exit, then add a A to the end of the file
#############start
#!/usr/local/bin/perl
$some_dir='.';
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
@dots = grep { /.jpg/ } readdir(DIR);
closedir DIR;
for (@dots) {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($_);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($mtime);
$year = sprintf("%02d", $year % 100);
$mon = sprintf("%02d", $mon % 100);
$mday = sprintf("%02d", $mday % 100);
$hour = sprintf("%02d", $hour % 100);
$min = sprintf("%02d", $min % 100);
$sec = sprintf("%02d", $sec % 100);
$new= "$year$mon$mday$hour$min$sec.jpg";
print "$new\n";
rename $_, $new;
}
#############end
> I have 1000 pictures files from digital camera. I want to rename the files
> so that the file will have the time stamp so that I can know where I took
> those pictures. If I FTP those files, the time stampe will always change
etc
> so I must include the time stamp into the filename. Here is what I want
PERL
> to do:
>
> Dir the directory
> Add each file's timestamp to the end of the file name.
>
> Anyone knows a little script to do that work?
>
>
------------------------------
Date: Wed, 03 Dec 2003 05:32:53 GMT
From: "Picker Leon" <Temp@NoSuchDomain.Info>
Subject: Re: Add File Names with Time Stamp
Message-Id: <9Aezb.143506$Ec1.5785498@bgtnsc05-news.ops.worldnet.att.net>
Fixed.
Change
rename $_, $new;
to
rename $_, $new if !stat($new);
Also you need to add 1 to the $mon.
"Picker Leon" <Temp@NoSuchDomain.Info> дÈëÓʼþ
news:gjezb.143453$Ec1.5784007@bgtnsc05-news.ops.worldnet.att.net...
> Here is what I wrote. Works 100%. But the only problem is if I have two
> files with the same timestamp, it will overwrite it. Can you fix it? If
the
> rename to exit, then add a A to the end of the file
> #############start
> #!/usr/local/bin/perl
> $some_dir='.';
>
> opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
> @dots = grep { /.jpg/ } readdir(DIR);
> closedir DIR;
>
> for (@dots) {
>
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
> $atime,$mtime,$ctime,$blksize,$blocks)
> = stat($_);
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime($mtime);
> $year = sprintf("%02d", $year % 100);
> $mon = sprintf("%02d", $mon % 100);
> $mday = sprintf("%02d", $mday % 100);
> $hour = sprintf("%02d", $hour % 100);
> $min = sprintf("%02d", $min % 100);
> $sec = sprintf("%02d", $sec % 100);
>
> $new= "$year$mon$mday$hour$min$sec.jpg";
> print "$new\n";
> rename $_, $new;
> }
> #############end
>
>
> > I have 1000 pictures files from digital camera. I want to rename the
files
> > so that the file will have the time stamp so that I can know where I
took
> > those pictures. If I FTP those files, the time stampe will always change
> etc
> > so I must include the time stamp into the filename. Here is what I want
> PERL
> > to do:
> >
> > Dir the directory
> > Add each file's timestamp to the end of the file name.
> >
> > Anyone knows a little script to do that work?
> >
> >
>
>
------------------------------
Date: Wed, 3 Dec 2003 05:45:31 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Add File Names with Time Stamp
Message-Id: <bqjt9r$sq5$1@wisteria.csv.warwick.ac.uk>
[please don't top-post: it is considered rude]
"Picker Leon" <Temp@NoSuchDomain.Info> wrote:
> Here is what I wrote. Works 100%. But the only problem is if I have two
> files with the same timestamp, it will overwrite it. Can you fix it? If the
> rename to exit, then add a A to the end of the file
> #############start
> #!/usr/local/bin/perl
You missed the all-important
use warnings;
use strict;
> $some_dir='.';
You will now need
my $some_dir = '.';
and similar for all the other variables.
> opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
> @dots = grep { /.jpg/ } readdir(DIR);
Here you want { /\.jpg$/ }.
> closedir DIR;
>
> for (@dots) {
>
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
> $atime,$mtime,$ctime,$blksize,$blocks)
> = stat($_);
I would always be inclined to use File::stat: put
use File::stat;
at the top and then you can simply say
my $mtime = stat($_)->mtime;
.
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime($mtime);
> $year = sprintf("%02d", $year % 100);
> $mon = sprintf("%02d", $mon % 100);
> $mday = sprintf("%02d", $mday % 100);
> $hour = sprintf("%02d", $hour % 100);
> $min = sprintf("%02d", $min % 100);
> $sec = sprintf("%02d", $sec % 100);
Why are all these '% 100'? $year, OK, it's necessary; the others will
never be greater than 100 anyway.
I would use POSIX::strftime for this: put
use POSIX qw/strftime/;
at the top and then say
my $timestamp = strftime "%y%m%d%H%M%S", localtime stat($_)->mtime;
, but I know there are those in this group who wouldn't :).
> $new= "$year$mon$mday$hour$min$sec.jpg";
> print "$new\n";
I am assuming here that when you say 'at the end of the file' you mean
before the '.jpg'? :)
Here you want to add:
my $ext = "";
while(-e "$timestamp$ext.jpg") {
$ext++;
$ext = "A" if $ext == 1;
}
> rename $_, $new;
rename $_, "$timestamp$ext.jpg";
There is a race condition here between the -e and the rename, which
basically means 'don't mess around and add files to the directory
while the script is running'.
> }
> #############end
Ben
--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. ben@morrow.me.uk
------------------------------
Date: Wed, 03 Dec 2003 03:53:19 GMT
From: "Guy" <someone@somewhere.nb.ca>
Subject: Can perl be used to test ISP upload speed?
Message-Id: <P6dzb.3630$IF6.170829@ursa-nb00s0.nbnet.nb.ca>
I suspect that this may not be in the proper newsgroup, and if so, please
ignore this posting.
I have perl 5.008 on a web server. I can create a perl script that can
manipulate data that is sent to it from an HTML form.
But I can't think of a way that perl could be used to test upload speed.
A good way to test upload speed would be to upload a file and calculate the
time it took to get there. But again I can't see how perl could be used to
test upload speed, and I'm wondering if it is possible.
I'm actually thinking that current online broadband speed tests use
something other that a server side script. I think they actually download a
small client side program?
Guy Doucet
------------------------------
Date: Wed, 03 Dec 2003 05:01:33 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Can perl be used to test ISP upload speed?
Message-Id: <bqjn76$23379n$1@ID-184292.news.uni-berlin.de>
Guy wrote:
> But I can't think of a way that perl could be used to test upload
> speed.
Then you don't know much about Perl, do you?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 03 Dec 2003 03:35:42 GMT
From: shb*NO*SPAM*@comporium.net (Si Ballenger)
Subject: Re: Don't Read - Testing
Message-Id: <3fcd595f.211612863@news.comporium.net>
On Tue, 02 Dec 2003 19:12:19 -0600, "Eric J. Roode"
<REMOVEsdnCAPS@comcast.net> wrote:
>"Alquemius" <Alquemius@hotmail.com> wrote in news:bqiu9a$h4i3
>@eui1nw.euskaltel.es:
>
>> Dont Read, that's a test!
>
>There are test newsgroups for this purpose (e.g. alt.test). Please don't
>pollute a technical newsgroup with test posts.
Maybe he is testing to see who can read AND comprehend vs those
that can't. ;-)
------------------------------
Date: Wed, 03 Dec 2003 04:18:45 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Don't Read - Testing
Message-Id: <Fudzb.17536$n4.394@nwrddc01.gnilink.net>
Alquemius wrote:
> Dont Read, that's a test!
Your wish is my command:
*PLONK*
jue
------------------------------
Date: Tue, 2 Dec 2003 22:51:57 -0800
From: "Tom" <tom@nosleep.net>
Subject: Re: Don't Read - Testing
Message-Id: <3fcd9509$1@nntp0.pdx.net>
> Why you would intend for the most-willing of question answerers to
> forever ignore your questions is a mystery...
>
really?
Mmm, well I guess.
After all, you all just wasted how many bytes of nonsense posting to a
test...lol
------------------------------
Date: Tue, 2 Dec 2003 23:09:08 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Don't Read - Testing
Message-Id: <k62kqb.1ul.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2003-12-03, Tom <tom@nosleep.net> wrote:
>
> Mmm, well I guess.
> After all, you all just wasted how many bytes of nonsense posting to a
> test...lol
So are you wasting bytes of nonsense responding to nonsense? I sense a
recursive algorithm here!
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/zYwFhVcNCxZ5ID8RArU0AJ4j1ZFMyYRd4O4C27unYaKDuqGZcgCcDusn
IqeUBzFve3sF+xmiUFmQQRo=
=SPq7
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 2 Dec 2003 23:40:43 -0800
From: "Tom" <tom@nosleep.net>
Subject: Re: Don't Read - Testing
Message-Id: <3fcda076$1@nntp0.pdx.net>
>
> So are you wasting bytes of nonsense responding to nonsense? I sense a
> recursive algorithm here!
>
> - --keith
and I knew that was coming :)
------------------------------
Date: Wed, 3 Dec 2003 18:28:12 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: Generating Day of Week in Pure Perl
Message-Id: <bqjsb2$22q9jl$1@ID-172104.news.uni-berlin.de>
"rev" <rev@TheWaterCooler.com> wrote in message
news:7qOyb.28801$2y3.5045@newssvr29.news.prodigy.com...
> I have a date formatted like so MM/DD/YYYY (e.g. 12/01/2003) and I need
> to get the day of the week from this (Monday). But, this is occurring
> on my hosting vendor so whatever does it needs to be pure Perl.
>
> I cannot use the POSIX package.
Why not? It provides a very simple and portable solution.
------------------------------
Date: Wed, 03 Dec 2003 07:52:32 GMT
From: qjason@cyberway.com.sg (Jason Quek)
Subject: multi-threading
Message-Id: <3fcd94b8.17161359@news.starhub.net.sg>
Hi
I have a long list of URLs and I need to do HTTP requests for each of
these domains.
# -----------------------------------------------------------------
@urls = (
'http://www.yahoo.com',
'http://www.google.com',
'http://www.msn.com',
'http://www.altavista.com'
);
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
foreach $url (@urls)
{
$req = HTTP::Request->new('GET', "$url");
$results = $ua->request($req)->as_string;
# then process $results
}
# -----------------------------------------------------------------
How do I multi-thread so that multiple URLs are http-requested at the
same time?
Any help would be appreciated.
Thank you
Jason Q.
------------------------------
Date: Wed, 03 Dec 2003 19:03:11 +1100
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: multi-threading
Message-Id: <bigiain-FE9050.19031103122003@news.fu-berlin.de>
In article <3fcd94b8.17161359@news.starhub.net.sg>,
qjason@cyberway.com.sg (Jason Quek) wrote:
> How do I multi-thread so that multiple URLs are http-requested at the
> same time?
See LWP::Parallel - its all done for you (and works _very_ well, thanks
Marc!)
http://search.cpan.org/~marclang/ParallelUserAgent-2.56/lib/LWP/Parallel.
pm
(watch the line wrapping on that)
big
--
'When I first met Katho, she had a meat cleaver in one hand and
half a sheep in the other. "Come in", she says, "Hammo's not here.
I hope you like meat.' Sharkey in aus.moto
------------------------------
Date: 2 Dec 2003 21:34:32 -0800
From: djberg96@hotmail.com (Daniel Berger)
Subject: Re: net::scp::expect error
Message-Id: <6e613a32.0312022134.54262725@posting.google.com>
ctippur@msn.com (Chandrashekar Tippur) wrote in message news:<629c1390.0312012051.69ccbe27@posting.google.com>...
> All,
>
> I am having some trouble with the module net::scp::expect. I am able
> to scp manually.
>
> The error that I am getting is:
>
> Error - last line returned was: pp
> | 3B | 3B/s | TOC: 0 at
> /tmp/.itverify-1038/perl/lib/perl5/site_perl/5.6.1/Expect.pm line 733
>
>
> Here is the snippet of code:
>
> $scpe = Net::SCP::Expect->new(host=>"$Host", user=>"$Login",
> password=>"$Passwd", port=>"$sshport", protocol=>2, auto_yes=>1) ||
> die "Incorrect Login or password\n";
> $scpe->scp("$line",'$remotepwd') || die "Hello";
>
> Please help.
>
> Thanks,
> Shekar
Hi Shekar,
I need some more info:
What platform?
Which version of ssh?
Also, try passing 'verbose => 1' and see if that gives you any more
detail. It looks like it's picking up some unexpected text at some
point. The verbose option should help me nail it down.
Regards,
Daniel Berger
------------------------------
Date: Wed, 03 Dec 2003 03:28:40 GMT
From: Gerard Lanois <gerardlanois@netscape.net>
Subject: Re: Newsgroup Searching Program
Message-Id: <uu14io9zr.fsf@netscape.net>
Mike Flannigan <mikeflan@earthlink.net> writes:
> # while we can go to the next message ....
> while(my $msgid=$nntp->last){
>
> I'm pretty sure I don't fully understand that statement,
> but I think it goes backwards from the highest message
> number (i.e. 494122) to more recent message numbers
> (i.e. 494120). And apparently, a higher message
> number does not directly correlate to a later date.
> So 494120 could be Dec. 1 08:05 hrs and 494122
> could be Dec. 1 07:45 hrs.
>
> My question is: Is this true?
Your statement that "a higher number does not directly correlate
to a later date" is correct.
I'm not sure exactly when a message is time tagged, maybe the RFC says.
In any case, also beware that there is no set time base - messages might
be either relative to UTC 00:00 or offset by a timezone from UTC 00:00.
> If I want my output to be
> date sorted, so I need to read the date and sort it
> manually,
That's how I've always done it. You will want to convert to a
common time base. The code to parse times and timezone offsets
has already been written - you will want to use something like
this:
my $absolute_datetime = time2str(
"%Y-%m-%d %X",
str2time($date),
"GMT"));
strtime is in the module Date::Parse, and time2str is in the
module Date::Format.
This absolute date format can be sorted lexicographically.
> or can it be done with message number or
> message ID, or something else I'm not seeing?
Note that there can be latency in the arrival of an article which
has travelled around the world, causing it to arrive later (and
thus be assigned a higher article number) than an article which
didn't have to travel quite so far.
In light of this information, maybe sorting by date isn't so
important.
So just using the article order on the server (the order in which
the articles arrive on the server, essentially) does give you a
chronological order, of sorts.
> Any comments on any of the code, or the logic of
> doing this at all, is appreciated.
Since you know you can skip over all article up through and
including $msg_no, you can do that more directly. And since
you know you alread processed $msg_no, you can just start off
with $msg_no+1. (warning, untested code ahead)
$first = ($first > $msg_no) ? $first : $msg_no+1;
my $x = 0;
for my $article_num ($first..$last) {
last if (++$x > 150);
if (my $article = $nntp->article($article_num)) {
# now do whatever iwith $article.
}
}
The if() around the $nntp->article() call is necessary due to
there being no guarantee that all the articles in the range are
actually on the server. Busy servers may have expired some of
your articles between the time you issued the $nntp->group call
and the $nntp->article call. Also, some servers don't always
give accurate information for $first and $last.
Good luck with your newsreader.
-Gerard
http://home.san.rr.com/lanois/perl/
------------------------------
Date: Wed, 3 Dec 2003 03:38:26 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Newsgroup Searching Program
Message-Id: <bqjlri$oaf$1@wisteria.csv.warwick.ac.uk>
Gerard Lanois <gerardlanois@netscape.net> wrote:
> my $absolute_datetime = time2str(
> "%Y-%m-%d %X",
> str2time($date),
> "GMT"));
>
> strtime is in the module Date::Parse, and time2str is in the
> module Date::Format.
>
> This absolute date format can be sorted lexicographically.
Isn't it easier just to sort the epoch times from str2time directly?
Ben
--
Although few may originate a policy, we are all able to judge it.
- Pericles of Athens, c.430 B.C.
ben@morrow.me.uk
------------------------------
Date: 2 Dec 2003 20:05:07 -0800
From: stimonyhall@netscape.net (Upstart)
Subject: Re: question about installation of GD::Text on cygwin (could be a Makefile q)
Message-Id: <79516caa.0312022005.5aead710@posting.google.com>
On Tue, 2 Dec 2003, Martien Verbruggen wrote:
> >> > For background: I am trying to install a few modules with an
> >> > environment of Cygwin w/ windows 2000. The module I am stuck on is
> >> > GD::Text.
>
> [snip]
>
> >> > that's it... no Makefile. no error messages. I am building other
> >> > modules (Like GD) and this step builds a Makefile with those modules.
>
> That is odd. very odd. I don't see how the inclusion of GD would
> conflict with MakeMaker.
>
> Just for the heck of it, could you do something like:
[snip]
I will try this and post results...
> And I do need to test for this. I got too many reports about tests
> failing, only to have to talk the person reporting it through
> correctly installing GD. This test is there to prevent those GD
> installations where libgd is compiled differently from GD to cause my
> mailbox to be filled.
What I did do is a print "$@\n"; after each test in the eval block doing
expression testing against $@ to see what is in that variable and I get:
$ perl Makefile.PL
Could not find/open font
Could not find/open font
So something is up with the die statement and the fact that it could not
find the test font in its' own directory! Also, could not find/open font
is not causing it to die... also "One" says 'or die' and "Two" says 'and
die'.
> I don't have your platform, so I can't even begin to try to reproduce
> this. Could you give me some more information about your platform?
> Versions of cygwin, perl, ExtUtils::MakeMaker, GD, Cwd, File::Spec,
> etc?
Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 3
Cygwin DLL version info:DLL version: 1.5.5
perl 5.8.2-1
$ perl -v
This is perl, v5.8.2 built for cygwin-thread-multi-64int
gd 2.0.15-1
libfreetype2-devel 2.1.5-1
libfreetype26 2.1.5-1
libgd-devel 2.0.15-1
libgd2 2.0.15-1
libgdbm 1.8.0-5
libjpeg62 6b-11
libjpeg6b 6b-8
/usr/lib/perl5 $ find . -name GD.pm -print
./site_perl/5.8.0/cygwin-multi-64int/GD.pm
./site_perl/5.8.2/cygwin-thread-multi-64int/GD.pm
version 2.11
$ find . -name MakeMaker.pm -print
./5.8.2/ExtUtils/MakeMaker.pm
version 6.17
$ find . -name Cwd.pm -print
./5.8.2/cygwin-thread-multi-64int/Cwd.pm
version 2.08
$ find . -name Spec.pm -print
./5.8.2/File/Spec.pm
version 0.86
Is the two versions of GD.pm causing the hiccup? Or should perl just
figure it out based on which perl is in the shebang/path?
> Just a weird hunch: If you change the "require Cwd;" to "use Cwd;",
> does that change anything? It shouldn't, but you never know... And
> File::Spec? Both modules are used internally in the MakeMaker stuff,
> maybe the missing import is confusing things, even though I believe it
> shouldn't.
ok so the eval block has:
eval
{
local $SIG{'__WARN__'};
require GD;
use File::Spec;
use Cwd;
....
With/without 'PREREQ_PM' => { 'GD' => 1 },
and got the same results. Also set the anonymous hash to 0.
> >< 'VERSION_FROM' => 'Text.pm',
> >< 'PREREQ_PM' => { 'GD' => 1 },
>
> Hmmm.. I'd like to leave this in. Maybe I'll just set it to 0. Could
> you try that instead? GD::Text has a prerequisite that some version of
> GD is installed, so I'd like the Makefile.PL to express that.
I set it to 0 and got the same results... even with the eval block
removed.
JIM
------------------------------
Date: Wed, 3 Dec 2003 04:43:04 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: question about installation of GD::Text on cygwin (could be a Makefile q)
Message-Id: <bqjpko$q6o$1@wisteria.csv.warwick.ac.uk>
stimonyhall@netscape.net (Upstart) wrote:
> /usr/lib/perl5 $ find . -name GD.pm -print
> ./site_perl/5.8.0/cygwin-multi-64int/GD.pm
> ./site_perl/5.8.2/cygwin-thread-multi-64int/GD.pm
<snip>
>
> Is the two versions of GD.pm causing the hiccup? Or should perl just
> figure it out based on which perl is in the shebang/path?
Aha! I think this may be your problem. Try the following:
perl -le'print for @INC'
and then try adding
$\ = "\n";
print for @INC;
to the top of Makefile.PL, *before* it makes any attempt to load
GD.pm. If either of those lists have the 5.8.0 dir before the 5.8.2
dir, that is your problem: extensions built against a perl without
threading are binary-incompatible with perls with.
If you don't have 5.8.0 installed any more you can just remove that
GD.pm, or indeed the whole 5.8.0/cygwin-multi-64int
directory. Otherwise you need to fix whatever it is is getting your
@INC in the wrong order: 5.8.2 dirs should be tried before 5.8.0
dirs.
Ben
--
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
ben@morrow.me.uk <=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=> (Kate Rusby)
------------------------------
Date: 3 Dec 2003 08:13:23 +0100
From: "W. Bauer" <nospam@nospam.net>
Subject: Re: s// problem
Message-Id: <Xns9446536BE9C61bauerwo@195.186.4.29>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in news:bqiv01$23spld$1@ID-
184292.news.uni-berlin.de:
>> Example:
>>
>> "abc def" a -->"abc def";a
>>
>> [^"][^a-z]+[\s][^a-z]+[^"]
>> matches these spaces correctly.
I was so desperate after two hours of trying regexp, I must have copied
something wrong.
> I think this does what you want:
>
> s/("[^"]*")|\s+/ $1 || ';' /eg;
>
GREAT, it does exactly what I needed.
> Please study "perldoc perlre" and "perldoc perlop" more carefully to
> get an understanding of what it does.
>
> It should be noted that there also are modules for handling this kind
> of replacement. Text::ParseWords is worth exploring, for instance.
That's a very valuable hint. Would you have also a hint how to find out
about which modules are available? As a newbie, I basically stick to the
tutorials and references on perldoc, but I haven't seen any overview of
the modules available.
Best regards, W. Bauer
------------------------------
Date: Wed, 03 Dec 2003 08:48:23 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: s// problem
Message-Id: <pan.2003.12.03.07.48.19.6364@aursand.no>
On Wed, 03 Dec 2003 08:13:23 +0100, W. Bauer wrote:
> Would you have also a hint how to find out about which modules are
> available? As a newbie, I basically stick to the tutorials and
> references on perldoc, but I haven't seen any overview of the modules
> available.
Depending on what you mean by "available", actually. For a list of
modules that come with your Perl distribution:
perldoc perlmodlib
Finding out which modules are installed on your system is a FAQ:
perldoc -q installed
For finding, and installing, new modules, visit CPAN:
http://www.cpan.org/
If you're running Linux, you can launch the CPAN interface from the
command line:
perl -MCPAN -e shell
--
Tore Aursand <tore@aursand.no>
"What we see depends mainly on what we look for." -- Sir John Lubbock
------------------------------
Date: Wed, 03 Dec 2003 07:51:53 GMT
From: Z Monteca <zmonteca@zmonteca.com>
Subject: Re: Session Management?
Message-Id: <tCgzb.8550$aw2.3845073@newssrv26.news.prodigy.com>
I have this problem with trying to implement Apache::Session::CacheAny.
Everytime I tie the session:
tie %session, 'Apache::Session::CacheAny', $id, {
CacheImpl => 'Cache::SizeAwareFileCache',
Namespace => 'bookstore',
DefaultExpiresIn => '12 hours',
AutoPurgeOnGet => 0,
AutoPurgeOnSet => 1,
MaxSize => 10_000,
};
no matter what I change the DefaultExpiresIn time to, my session variables
last max two minutes? Does anybody have any idea why this is happening?
Also, to use a persistent session, I would have to essentially tie %session
in every file where I want this session to exist, correct?
Thanks in advance.
-Z
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 5885
***************************************