[30956] in Perl-Users-Digest
Perl-Users Digest, Issue: 2201 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 00:09:49 2009
Date: Tue, 10 Feb 2009 21:09:15 -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 Tue, 10 Feb 2009 Volume: 11 Number: 2201
Today's topics:
Re: [OT] Programmers (UK)...? <cliff@excite.com>
Re: [OT] Programmers (UK)...? <uri@stemsystems.com>
Re: A good data structure to store INI files. sln@netherlands.com
Re: automating a perl installation on a cluster (or usi <ben@morrow.me.uk>
Re: automating a perl installation on a cluster (or usi <nospam@nospam.invalid>
Re: automating a perl installation on a cluster (or usi <nospam@nospam.invalid>
Re: automating a perl installation on a cluster (or usi <nospam@nospam.invalid>
Re: automating a perl installation on a cluster (or usi <ben@morrow.me.uk>
Re: automating a perl installation on a cluster (or usi <ben@morrow.me.uk>
Can I write CPAN Modules for a living? sln@netherlands.com
Re: error printing page using LWP::Simple <ben@morrow.me.uk>
Re: error printing page using LWP::Simple <hansmu@xs4all.nl>
Re: error printing page using LWP::Simple sln@netherlands.com
Re: error printing page using LWP::Simple <ben@morrow.me.uk>
Re: error printing page using LWP::Simple <tim@burlyhost.com>
perl cpan autobundle not found <nospam@nospam.invalid>
Re: Perl vs. .NET (was: Re: Programmers (UK)...?) sln@netherlands.com
Possible bug in caller(0) ? <szrRE@szromanMO.comVE>
Re: Renaming file - Permission Denied <ben@morrow.me.uk>
Re: Renaming file - Permission Denied <a_person@anyolddomain.fake>
Re: Renaming file - Permission Denied <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Feb 2009 22:20:05 -0500
From: Cliff MacGillivray <cliff@excite.com>
Subject: Re: [OT] Programmers (UK)...?
Message-Id: <gmtg5b$q19$1@aioe.org>
Uri Guttman wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> TJM> If you knew anything about usenet you would know that mentioning
> TJM> your line of business in a .sig is perfectly acceptable.
>
> best to ignore this troll (as with all trolls). he has stalked me on irc
> as well. not sure why i am his target but he also defended moronzilla
> too which says a lot.
>
> >> it wasn't spam.
> >> Yes, it was.
>
> it is stalking by this troll. he will deny it.
>
> as for my being unemployed, one of my businesses is helping others get
> employed. kind of ironic for the troll to point at that. i am gainfully
> employed by myself and have been for many successful years.
Well, a little bird tells me that you got shitcanned from
Athena for gross incompetence. There may have been some personal
hygiene issues too. The source did not want to reveal too much lest he
be identifiable by way of the information given.
The question remains how you can legitimately claim to be a
successful recruiter for programmers when you yourself
have such mixed employment results yourself.
You see, if you want to go spamming your sham
employment service you need to be able to defend it
against such legitimate criticism.
------------------------------
Date: Wed, 11 Feb 2009 00:07:49 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: [OT] Programmers (UK)...?
Message-Id: <x7ljsdd0ii.fsf@mail.sysarch.com>
>>>>> "CM" == Cliff MacGillivray <cliff@excite.com> writes:
CM> Uri Guttman wrote:
>>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
TJM> If you knew anything about usenet you would know that
>> mentioning
TJM> your line of business in a .sig is perfectly acceptable.
>> best to ignore this troll (as with all trolls). he has stalked me on
>> irc
>> as well. not sure why i am his target but he also defended moronzilla
>> too which says a lot.
>> >> it wasn't spam.
>> >> Yes, it was. it is stalking by this troll. he will deny it.
>> as for my being unemployed, one of my businesses is helping others
>> get
>> employed. kind of ironic for the troll to point at that. i am gainfully
>> employed by myself and have been for many successful years.
CM> Well, a little bird tells me that you got shitcanned from
CM> Athena for gross incompetence. There may have been some personal
amusing. i wouldn't have wanted to stay there. i finished up my contract
there and we mutually agreed to not continue. no firing ever
happened. you don't know athena at all. nor do you know their codebase
and development culture. and you also don't know perl. seems like there
is a lot you don't know.
CM> The question remains how you can legitimately claim to be a
CM> successful recruiter for programmers when you yourself have such
CM> mixed employment results yourself. You see, if you want to go
CM> spamming your sham employment service you need to be able to
CM> defend it against such legitimate criticism.
like you really want a perl job and care? you are just a stalker who has
no perl skills. go find moronzilla and form a cult of 2 member. have
fun!
as for perlhunter, it is doing just fine. not much you can find out
about the actual business so you have to lie. now go away and crawl back
under your rock. you have been banned from all the irc channels and if
usenet could do it, it would ban you too. but everyone else will
killfile you and you will be blathering into the ether with no one to
listen. the worst punishment for you is being you.
as to why you choose to stalk me, i couldn't care less. the alaskan
electrician didn't scare me and you are about as annoying as a speck of
dust. please keep doing this and make it the focus of your life. i will
enjoy seeing you go madder just going after me. stalking is a
sickness. go see a doctor or many doctors.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 11 Feb 2009 01:03:43 GMT
From: sln@netherlands.com
Subject: Re: A good data structure to store INI files.
Message-Id: <2p84p4hg18ll932rjcq3k34nh322t3u8r8@4ax.com>
On Tue, 10 Feb 2009 21:40:17 GMT, sln@netherlands.com wrote:
>On Tue, 10 Feb 2009 21:28:11 GMT, sln@netherlands.com wrote:
>
>>On Tue, 10 Feb 2009 21:34:36 +0100, Marc Lucksch <perl@marc-s.de> wrote:
>>
>>>sln@netherlands.com schrieb:
>>>> On Tue, 10 Feb 2009 19:53:51 GMT, sln@netherlands.com wrote:
>>>>
>>>>> On Tue, 10 Feb 2009 19:42:57 GMT, sln@netherlands.com wrote:
>>>>> The other alternative is where each section and key a hash key
>>>>> that is an array reference consisting of the order obtained, type and
>>>>> a value array reference (undef on sections). Sort the orer and print
>>>>> out the section/key/value.
>>>>>
>>>>> -sln
>>>>
>[snip]
>>
>>I highly recommend this method.
>>-sln
>>
>>*******************************************************
>>
>>sub new_node # modified (correct below)
>>{
>> my $node = {
>> # Node Header
>> prev => undef,
>> next => undef,
>> # Node Data
>> data => { section => '',
>> key => '',
>> value => ''
>> }
>> };
>> return $node;
>>}
>>
>
>This would be better for you, get rid of 'data' altogether.
>You will have to adjust a couple of undef's for the 'data'
>hash in the clear methods in the core though.
>
>sub new_node # modified ( need to correct below)
>{
> my $node = {
> # Node Header
> prev => undef,
> next => undef,
> # Node Data
> section => '',
> key => '',
> value => ''
> };
> return $node;
>}
>To traverse:
>
># Traverse the list from the Head, print data
>#-
> print "\nTraverse list from Head -\n";
> $curnode = $ListHead;
> while (defined $curnode)
> {
> if (defined $curnode->{section}) {
> print "section = ".$curnode->{section}."\n";
> print "key = ".$curnode->{key}."\n";
> print "value = ".$curnode->{value}."\n";
> }
> $curnode = $curnode->{next};
> }
>
>-sln
I am assuming you gave up and committed suicide.
Node's are your only hope to manage this. Trust me.
If you are between a rock and a hard place. I will actually
do this for you in about 20 minutes. The entire thing, including
user presentation.
I will do it for fun, until I get employment.
-sln
------------------------------
Date: Tue, 10 Feb 2009 23:29:13 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <97f966-lu1.ln1@osiris.mauzo.dyndns.org>
Quoth Rahul <nospam@nospam.invalid>:
>
> I tried installing ExtUtils-MakeMaker-6.48, the first step in all my
> dependancies. But I get this error when I try "make" that I can't really
> figure out.
>
> [root@star255 ExtUtils-MakeMaker-6.48]# perl Makefile.PL
> INSTALL_BASE=/usr/local
> Using included version of ExtUtils::Command (1.14) as it is newer than the
> installed version (1.09).
> Writing Makefile for ExtUtils::MakeMaker
>
> [root@star255 ExtUtils-MakeMaker-6.48]# make
> make: *** No rule to make target `/usr/lib64/perl5/5.8.8/x86_64-linux-
> thread-multi/CORE/config.h', needed by `Makefile'. Stop.
Does that file exist? What does
perl -V:archlib
print? Does the file CORE/config.h exist in that directory?
Do you have either of PERL5LIB or PERL_MM_OPT set in your environment
(or any other vars beginning with PERL)?
If you don't have the perl headers installed, your OS may have split up
the perl distribution in a misguided effort to save space. You may need
to install some sort of perl-dev or perl-headers package to get them.
Ben
------------------------------
Date: Wed, 11 Feb 2009 00:36:14 +0000 (UTC)
From: Rahul <nospam@nospam.invalid>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <Xns9BAEBD3F7573F6650A1FC0D7811DDBC81@85.214.105.209>
Ben Morrow <ben@morrow.me.uk> wrote in news:97f966-lu1.ln1
@osiris.mauzo.dyndns.org:
> Does that file exist? What does
Thanks again Ben! locate on config.h does not throw any such file.
> perl -V:archlib
>
> print? Does the file CORE/config.h exist in that directory?
#>perl -V:archlib
archlib='/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi';
ANd no config.h to be found once again!
#>ls /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/
libperl.so reentr.inc sperl.o
> Do you have either of PERL5LIB or PERL_MM_OPT set in your environment
> (or any other vars beginning with PERL)?
Nope. No PERL vars set.
export | grep PERL throws a null.
--
Rahul
------------------------------
Date: Wed, 11 Feb 2009 00:37:54 +0000 (UTC)
From: Rahul <nospam@nospam.invalid>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <Xns9BAEBD8808316650A1FC0D7811DDBC81@85.214.105.209>
Ben Morrow <ben@morrow.me.uk> wrote in news:97f966-lu1.ln1
@osiris.mauzo.dyndns.org:
> If you don't have the perl headers installed, your OS may have split up
> the perl distribution in a misguided effort to save space. You may need
> to install some sort of perl-dev or perl-headers package to get them.
>
Oh! That was it.
I needed a " yum install perl-devel.x86_64"
Now for ExtUtils-MakeMaker-6.48 the make works!
Strange! I'd never have figured this out by myself! Thanks for all your
help Ben! Let's see if I can finally get perl to install modules to a non-
default location!
This seems like a very uphill battle!
--
Rahul
------------------------------
Date: Wed, 11 Feb 2009 00:47:18 +0000 (UTC)
From: Rahul <nospam@nospam.invalid>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <Xns9BAEBF200B5426650A1FC0D7811DDBC81@85.214.105.209>
Ben Morrow <ben@morrow.me.uk> wrote in
news:edq166-a0h.ln1@osiris.mauzo.dyndns.org:
> This is probably because you set PREFIX wrong. You've probably ended
> up installing somewhere like
> /usr/local/lib/perl/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-mul
> ti, which is several levels deeper than you meant. If you use
> INSTALL_BASE=/usr/local you should instead get modules in
> /usr/local/lib/perl5/x86_64-linux-thread-multi, which
> PERL5LIB=/usr/local/lib/perl5 will find just fine (see below).
>
Almost. I get them in:
/usr/local/lib/perl5/ExtUtils/MM.pm
So very close to the "correct" path that you predicted. I'm not sure if
the absence of "x86_64-linux-thread-multi" is indicative of any trouble!
--
Rahul
------------------------------
Date: Wed, 11 Feb 2009 02:21:01 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <d9p966-du3.ln1@osiris.mauzo.dyndns.org>
Quoth Rahul <nospam@nospam.invalid>:
> Ben Morrow <ben@morrow.me.uk> wrote in news:97f966-lu1.ln1
> @osiris.mauzo.dyndns.org:
>
> > If you don't have the perl headers installed, your OS may have split up
> > the perl distribution in a misguided effort to save space. You may need
> > to install some sort of perl-dev or perl-headers package to get them.
> >
>
> Oh! That was it.
>
> I needed a " yum install perl-devel.x86_64"
>
> Now for ExtUtils-MakeMaker-6.48 the make works!
>
> Strange! I'd never have figured this out by myself! Thanks for all your
> help Ben! Let's see if I can finally get perl to install modules to a non-
> default location!
>
> This seems like a very uphill battle!
Yes. The basic problem here is you are trying to mix things that don't
mix. There are two supported approaches here:
1. Use yum, and stick entirely to yum-provided packages installed in
yum-managed locations,
2. Do it all yourself, starting by building your own perl.
2 is initially harder than 1, in that you will need to learn how to
Configure perl, choose where to install everything so it doesn't
conflict with the system perl, and handle non-Perl dependancies by hand;
but it may well be easier than trying to make a yum-managed perl install
properly from CPAN.
Ben
------------------------------
Date: Wed, 11 Feb 2009 02:24:20 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: automating a perl installation on a cluster (or using non-standard nfs paths)
Message-Id: <kfp966-du3.ln1@osiris.mauzo.dyndns.org>
Quoth Rahul <nospam@nospam.invalid>:
> Ben Morrow <ben@morrow.me.uk> wrote in
> news:edq166-a0h.ln1@osiris.mauzo.dyndns.org:
>
> > This is probably because you set PREFIX wrong. You've probably ended
> > up installing somewhere like
> > /usr/local/lib/perl/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-mul
> > ti, which is several levels deeper than you meant. If you use
> > INSTALL_BASE=/usr/local you should instead get modules in
> > /usr/local/lib/perl5/x86_64-linux-thread-multi, which
> > PERL5LIB=/usr/local/lib/perl5 will find just fine (see below).
>
> Almost. I get them in:
>
> /usr/local/lib/perl5/ExtUtils/MM.pm
>
> So very close to the "correct" path that you predicted. I'm not sure if
> the absence of "x86_64-linux-thread-multi" is indicative of any trouble!
That's because ExtUtils::MM (or rather, ExtUtils::MakeMaker which it is
a part of) is a pure-Perl module, so the ARCH component of the path is
omitted. When you install some module with an XS component you will find
it goes in the ARCH directory.
In any case, you should find PERL5LIB=/usr/local/lib/perl5 allows perl
to find the module correctly?
Ben
------------------------------
Date: Wed, 11 Feb 2009 02:01:23 GMT
From: sln@netherlands.com
Subject: Can I write CPAN Modules for a living?
Message-Id: <frb4p4h9tr4lq4u82bdu5mgrcpnccvk8ls@4ax.com>
I'm pretty desperate for a job, won't program for food yet, but close.
My resume is loaded with C/C++, MFC, STL, ADO, etc..
Not getting hits at all. Perl is just barely on my resume, haven't put on
it that I'm an expert in waiting, specially Regular Expressions. So nobody
know's to hire me, if they hire RX experts, I don't know.
I could learn anything an eployer needs, that I don't know in about 26 minutes,
thats the way it is u know. When you know HOW to find things out quickly and the
absorption is instantaneous, because it fits in your broad substructure framework of
knowledge.
So, I ask this humble question: Can I make money writing CPAN Modules?
If not, what good are CPAN Modules for anybody at all?
I know for sure I can be a bitch CPAM Module writer...
-sln
------------------------------
Date: Tue, 10 Feb 2009 23:14:12 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: error printing page using LWP::Simple
Message-Id: <4be966-lu1.ln1@osiris.mauzo.dyndns.org>
Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> On 2009-02-10 18:08, Brad Baxter <baxter.brad@gmail.com> wrote:
> > On Feb 6, 6:21 am, Peter Makholm <pe...@makholm.net> wrote:
> >> my $t = get($url) // "Fail!";
> >>
> >> Uhmmm, we don't have a low precedence version of '//'?
No. See http://markmail.org/message/bmhjbbansjup75nv . (The [RULE ONE]
prefix means 'this is being done because Larry says so'.)
> > I thought it was 'dor', but I don't see it in, e.g.,
> > http://perldoc.perl.org/perlop.html
It was never 'dor'. Merijn's 'dor' patch for 5.8 added '//', '//=' and
'err' operators, in line with the Perl 6 spec at the time, but by the
time the feature was merged into 5.10 Perl 6 had changed, so the
low-precedence version was dropped for now.
> In Perl6 it is (or was, last time I looked at it) "err".
It is now 'orelse', since some people on p5p strongly objected to 'err',
and it has an 'andthen' counterpart. I'm not following p6l closely
enough to know what it's meant to be used for, but I understand it's no
longer meant as a simple replacement for 'or' in 'or die'-like
constructions. The names at least suggest they are intended to be
Prolog-like operators.
Ben
------------------------------
Date: Wed, 11 Feb 2009 00:44:21 +0100
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: error printing page using LWP::Simple
Message-Id: <4992129c$0$193$e4fe514c@news.xs4all.nl>
Tim Greer wrote:
> Gunnar Hjalmarsson wrote:
>
>>> my $t = get $url || "There was a problem";
>> Same objection.
>
> By the way, I'm not familiar with this module and function, simply
> because I've not used it before myself (I use other solutions), but I'm
> curious what the objection above is? As in, I realize it doesn't say
> why it failed, but I didn't see any method to have it report the
> failure... I mean, since it just returns undefined if there's a
> failure.
It's a precedence issue: 'get' is a list operator, so it binds less
tightly than the '||' operator, so the code is interpreted as:
my $t = get($url || 'There was a problem');
The OP probably wants:
my $t = get($url) || 'There was a problem';
Which is exactly the same as:
my $t = (get $url or "There was a problem");
, because 'or' bind less tightly than list operators (and also less
tightly than '=', which is why you need the parenthesis around the
right hand side of the '=' if you use 'or').
Hope this helps,
-- HansM
------------------------------
Date: Wed, 11 Feb 2009 00:23:25 GMT
From: sln@netherlands.com
Subject: Re: error printing page using LWP::Simple
Message-Id: <5j64p4dq5dtr1p0fa2fl9okjcug03tu8us@4ax.com>
On Tue, 10 Feb 2009 23:14:12 +0000, Ben Morrow <ben@morrow.me.uk> wrote:
>
>Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>> On 2009-02-10 18:08, Brad Baxter <baxter.brad@gmail.com> wrote:
>> > On Feb 6, 6:21 am, Peter Makholm <pe...@makholm.net> wrote:
>> >> my $t = get($url) // "Fail!";
>> >>
>> >> Uhmmm, we don't have a low precedence version of '//'?
>
>No. See http://markmail.org/message/bmhjbbansjup75nv . (The [RULE ONE]
>prefix means 'this is being done because Larry says so'.)
>
>> > I thought it was 'dor', but I don't see it in, e.g.,
>> > http://perldoc.perl.org/perlop.html
>
>It was never 'dor'. Merijn's 'dor' patch for 5.8 added '//', '//=' and
>'err' operators, in line with the Perl 6 spec at the time, but by the
>time the feature was merged into 5.10 Perl 6 had changed, so the
>low-precedence version was dropped for now.
>
>> In Perl6 it is (or was, last time I looked at it) "err".
>
>It is now 'orelse', since some people on p5p strongly objected to 'err',
>and it has an 'andthen' counterpart. I'm not following p6l closely
>enough to know what it's meant to be used for, but I understand it's no
>longer meant as a simple replacement for 'or' in 'or die'-like
>constructions. The names at least suggest they are intended to be
>Prolog-like operators.
>
>Ben
I guess LWP aint so Simple
-sln
------------------------------
Date: Wed, 11 Feb 2009 02:46:51 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: error printing page using LWP::Simple
Message-Id: <rpq966-f54.ln1@osiris.mauzo.dyndns.org>
Quoth Hans Mulder <hansmu@xs4all.nl>:
> Tim Greer wrote:
> > Gunnar Hjalmarsson wrote:
> >
> >>> my $t = get $url || "There was a problem";
> >> Same objection.
> >
> > By the way, I'm not familiar with this module and function, simply
> > because I've not used it before myself (I use other solutions), but I'm
> > curious what the objection above is? As in, I realize it doesn't say
> > why it failed, but I didn't see any method to have it report the
> > failure... I mean, since it just returns undefined if there's a
> > failure.
>
> It's a precedence issue: 'get' is a list operator, so it binds less
> tightly than the '||' operator, so the code is interpreted as:
>
> my $t = get($url || 'There was a problem');
>
> The OP probably wants:
>
> my $t = get($url) || 'There was a problem';
>
> Which is exactly the same as:
>
> my $t = (get $url or "There was a problem");
>
> , because 'or' bind less tightly than list operators (and also less
> tightly than '=', which is why you need the parenthesis around the
> right hand side of the '=' if you use 'or').
You don't, though.
my $t = get $url or die;
is equivalent to
(my $t = get($url)) or die;
which will die just fine. In fact, unlike any of your examples, it will
die *after* assigning to $t, which is usually what you want (if, for
example, it wasn't a fresh variable but previously had a value).
Ben
------------------------------
Date: Tue, 10 Feb 2009 20:08:08 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: error printing page using LWP::Simple
Message-Id: <Iaskl.13385$Kr1.9499@newsfe13.iad>
Hans Mulder wrote:
> Tim Greer wrote:
>> Gunnar Hjalmarsson wrote:
>>
>>>> my $t = get $url || "There was a problem";
>>> Same objection.
>>
>> By the way, I'm not familiar with this module and function, simply
>> because I've not used it before myself (I use other solutions), but
>> I'm
>> curious what the objection above is? As in, I realize it doesn't say
>> why it failed, but I didn't see any method to have it report the
>> failure... I mean, since it just returns undefined if there's a
>> failure.
>
> It's a precedence issue: 'get' is a list operator, so it binds less
> tightly than the '||' operator, so the code is interpreted as:
>
> my $t = get($url || 'There was a problem');
>
> The OP probably wants:
>
> my $t = get($url) || 'There was a problem';
>
> Which is exactly the same as:
>
> my $t = (get $url or "There was a problem");
>
> , because 'or' bind less tightly than list operators (and also less
> tightly than '=', which is why you need the parenthesis around the
> right hand side of the '=' if you use 'or').
>
>
> Hope this helps,
>
> -- HansM
I'm aware of the differences in || and or, I was just responding to a
previus example, where the other wouldn't work (try the earlier example
I was replying to to see). As Ben also mentioned, it's the same. I
get what you mean, I just guess you didn't get what I meant (I wasn't
disagreeing with you. :-)
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
------------------------------
Date: Wed, 11 Feb 2009 01:20:42 +0000 (UTC)
From: Rahul <nospam@nospam.invalid>
Subject: perl cpan autobundle not found
Message-Id: <Xns9BAEC4C9834EB6650A1FC0D7811DDBC81@85.214.105.209>
I tried "perl -MCPAN -e autobundle" and it writes its data to
/root/.cpan/Bundle/Snapshot_2009_02_10_01.pm
On a new machine I tried "perl -MCPAN -e 'install Bundle::Snapshot_2009_02_
10_01'" but it does not seem to find it:
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Tue, 10 Feb 2009 12:26:55 GMT
Warning: Cannot install Bundle::Snapshot_2009_02_10_00, don't know what it
is.
Is there a special location I should be storing my Snapshot in? Or is there
a procedure to specify the full path?
--
Rahul
------------------------------
Date: Wed, 11 Feb 2009 01:42:27 GMT
From: sln@netherlands.com
Subject: Re: Perl vs. .NET (was: Re: Programmers (UK)...?)
Message-Id: <q3b4p4lh0bg5rglcn9f5aj3isf63qk4r3t@4ax.com>
On Mon, 9 Feb 2009 02:51:54 +0000, Ben Morrow <ben@morrow.me.uk> wrote:
>
>Quoth Tim Greer <tim@burlyhost.com>:
>> sln@netherlands.com wrote:
>
>Please stop talking to trolls.
>
>Ben
Well Ben, I will stop talking to your crack induced responses
when I see them, and remind you that your retardation knowns no
bounds.
How bout that jackoff?
-sln
------------------------------
Date: Tue, 10 Feb 2009 20:55:46 -0800
From: "szr" <szrRE@szromanMO.comVE>
Subject: Possible bug in caller(0) ?
Message-Id: <gmtloj027ii@news6.newsguy.com>
Given the code and output below, I believe there to be a bug in caller,
specifically when called with a sole argument of 0 (zero.) In the output
below, I get back the subroutine (method), B::foo, which is located in
Package "B", inside file Test.pm, at line 10, yet caller(0) is yielding
Package "main", file main.pl, and line 8.
The latter location is where 'foo' was called /from/, but caller(0),
according to `perldoc5.10.0 -f caller`, whose first four elements are
defined as "$package, $filename, $line, $subroutine", states that:
The value of EXPR indicates how many call frames to go back
before the current one.
Therefore 0 should be the current frame, and while the subroutine is
correct, is appears the package, file, and line number (aka, the
location of said subroutine), is incorrect. I would have expected
caller(1) to return where it was called _from_, but caller(0) be giving
the location of the subroutine where caller was called.
If I am missing something, please let me know. I have thought though
this for a couple hours and read over that perldoc entry several times
before writing this.
Thank you.
###### Output #####
$ ./main.pl
[main, ./main.pl, 8, B::foo]
$ # shouldn't this be [B, ./Test.pm, 10, B::foo] ?
###################
##### Test.pm #####
package B;
use strict;
sub new {
my $this = shift;
return bless { }, ref($this) || $this;
}
sub foo {
my $this = shift;
return join (', ', (caller(0))[0..3]);
}
package D;
use strict;
our @ISA = qw(B);
sub new {
my $this = shift;
my $class = ref($this) || $this;
my $obj = $class->SUPER::new(@_);
return bless $obj, $class;
}
1;
###################
##### main.pl #####
#!/usr/bin/perl -w
use strict;
use lib '.';
use Test;
my $d = new D;
print "[", $d->foo(), "]\n";
###################
--
szr
------------------------------
Date: Tue, 10 Feb 2009 23:37:06 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Renaming file - Permission Denied
Message-Id: <2mf966-lu1.ln1@osiris.mauzo.dyndns.org>
Quoth "Bigus" <a_person@anyolddomain.fake>:
> Hi.
>
> I have a script that recurses through a directory tree looking for OTF
> fonts. When it finds one it extracts the postscript name and if the filename
> is different then it attempts to rename the font file. However, it doesn't
> rename the file and returns permission denied.
>
> Strangely though, if I try the rename command stand-alone, ie: outside of
> the loop where it runs through the files in the directory, it works. I'm
> clutching at straws a bit here but is there some issue with renaming files
> in a directory which is currently subject to the opendir command, or is it
> something else entirely?
I'm going to take a wild guess and assume you're on Win32 :). You cannot
rename a file while it's open on Win32, so you will need to get the
Font::TTF::Font object to close the file before you do the rename. There
is also sometimes an issue with virus scanners: if the scanner is set to
scan-on-close, you can get the scanner re-opening the file immediately
so you still can't rename it. If you can't kill your virus scanner try
adding a sleep of a few seconds before the rename.
> Here's the code:
>
> ----------------------------------------------
>
> use strict;
use warnings;
> use File::Copy;
> use Font::TTF::Font;
>
> recurser();
>
> # -- recurse through 3 levels of folders -- #
> sub recurser {
>
> my $fromdir = "e:/software/fonts/";
> my $fontext = "otf";
>
> # level 1
> opendir D1, $fromdir;
You can use lexical dirhandles, as well.
opendir my $D1, $fromdir or die "can't open '$fromdir': $!";
Variables with numbers in the names are usually an indication you should
be using an array instead.
In any case, you should be using File::Find or File::Find::Rule or
something instead of rolling your own.
<snippety>
> next if $font3 !~ /$fontext$/i;
This is incorrect. You mean /\.$fontext$/i, otherwise you will catch
files called 'foo.gotf' and such like.
Ben
------------------------------
Date: Wed, 11 Feb 2009 00:30:08 -0000
From: "Bigus" <a_person@anyolddomain.fake>
Subject: Re: Renaming file - Permission Denied
Message-Id: <49921c14$0$25636$8d2e0cab@news.newsgroup-binaries.com>
Thanks for the reply.
"Ben Morrow" <ben@morrow.me.uk> wrote in message
news:2mf966-lu1.ln1@osiris.mauzo.dyndns.org...
> I'm going to take a wild guess and assume you're on Win32 :).
Yes indeed :-)
> You cannot
> rename a file while it's open on Win32, so you will need to get the
> Font::TTF::Font object to close the file before you do the rename. There
> is also sometimes an issue with virus scanners: if the scanner is set to
> scan-on-close, you can get the scanner re-opening the file immediately
> so you still can't rename it. If you can't kill your virus scanner try
> adding a sleep of a few seconds before the rename.
Nice idea. I had a look at the docs again for Font::TTF::Font and can't find
a close function but there is a "release" one which:
[quote]
Releases ALL of the memory used by the TTF font and all of its component
objects. After calling this method, do NOT expect to have anything left in
the Font::TTF::Font object
[/quote]
So the bit of the code that gets the postscript name is now:
my $f = Font::TTF::Font->open($fontdir.$font);
my $t = $f->{name}->read;
my $psname = $t->{strings}[6][1][0]{0};
$f->release();
It doesn't work though. I also disabled my virus scanner and put a sleep of
a couple of seconds just before the rename for good measure but it's still
failing to rename the font file :-(
>> # level 1
>> opendir D1, $fromdir;
>
> You can use lexical dirhandles, as well.
>
> opendir my $D1, $fromdir or die "can't open '$fromdir': $!";
>
> Variables with numbers in the names are usually an indication you should
> be using an array instead.
>
> In any case, you should be using File::Find or File::Find::Rule or
> something instead of rolling your own.
Oh yes, thanks, that's a nifty module. Think I used that a few years ago but
had forgotten about it.
> <snippety>
>> next if $font3 !~ /$fontext$/i;
>
> This is incorrect. You mean /\.$fontext$/i, otherwise you will catch
> files called 'foo.gotf' and such like.
Aye, I realise that but I know there are only font files in the directories
I'm trawling through so didn't bother with the \. :)
Regards
Bigus
-----------------
www.Newsgroup-Binaries.com - *Completion*Retention*Speed*
Access your favorite newsgroups from home or on the road
-----------------
------------------------------
Date: Wed, 11 Feb 2009 02:42:57 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Renaming file - Permission Denied
Message-Id: <hiq966-f54.ln1@osiris.mauzo.dyndns.org>
Quoth "Bigus" <a_person@anyolddomain.fake>:
> "Ben Morrow" <ben@morrow.me.uk> wrote in message
> news:2mf966-lu1.ln1@osiris.mauzo.dyndns.org...
>
> > You cannot
> > rename a file while it's open on Win32, so you will need to get the
> > Font::TTF::Font object to close the file before you do the rename. There
> > is also sometimes an issue with virus scanners: if the scanner is set to
> > scan-on-close, you can get the scanner re-opening the file immediately
> > so you still can't rename it. If you can't kill your virus scanner try
> > adding a sleep of a few seconds before the rename.
>
> Nice idea. I had a look at the docs again for Font::TTF::Font and can't find
> a close function but there is a "release" one which:
>
> [quote]
> Releases ALL of the memory used by the TTF font and all of its component
> objects. After calling this method, do NOT expect to have anything left in
> the Font::TTF::Font object
> [/quote]
>
> So the bit of the code that gets the postscript name is now:
>
> my $f = Font::TTF::Font->open($fontdir.$font);
> my $t = $f->{name}->read;
> my $psname = $t->{strings}[6][1][0]{0};
> $f->release();
>
> It doesn't work though. I also disabled my virus scanner and put a sleep of
> a couple of seconds just before the rename for good measure but it's still
> failing to rename the font file :-(
Looking through the source (yuck, that's a fairly unpleasant module), it
appears that ->release doesn't actually close the file. It look like
allowing the object to go out of scope should do that, so you want
something like
my $psname;
{
my $f = Font::TTF::Font->open($fontdir.$font);
my $t = $f->{name}->read;
$psname = $t->{strings}[6][1][0]{0};
$f->release;
}
rename ...;
If not, then either close $f->{' INFILE'} by hand (evil, but it should
work :) ) or use
my $file = $fontdir.$font;
open my $fh, "<", $file or die "can't open '$file': $!";
my $f = Font::TTF::Font->new(
INFILE => $fh,
fname => $file,
OFFSET => 0,
);
$f->read;
close $fh;
instead of the ->open call (don't ask me why those parameters are
undocumented, why they're different cases or why you have to explicitly
specify the OFFSET...).
Ben
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 2201
***************************************