[29062] in Perl-Users-Digest
Perl-Users Digest, Issue: 306 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 5 09:14:18 2007
Date: Thu, 5 Apr 2007 06:14:09 -0700 (PDT)
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, 5 Apr 2007 Volume: 11 Number: 306
Today's topics:
Re: perl OOP <abigail@abigail.be>
Re: perl OOP <spamtrap@dot-app.org>
Re: perl OOP <spamtrap@dot-app.org>
Re: perl OOP <please@nospam.net>
Re: perl OOP <please@nospam.net>
Re: perl OOP <spamtrap@dot-app.org>
Re: perl OOP <spamtrap@dot-app.org>
Re: perl OOP <bik.mido@tiscalinet.it>
Re: Problem installing Errno <bol@adv.magwien.gv.at>
Re: Problem installing Errno <spamtrap@dot-app.org>
Re: profiling - analyse by time "on behalf of"? <hjp-usenet2@hjp.at>
Re: Testing against a list of values ? <wahab-mail@gmx.de>
Re: Testing against a list of values ? <rvtol+news@isolution.nl>
Re: Testing against a list of values ? <zen13097@zen.co.uk>
Re: Testing against a list of values ? <abigail@abigail.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 05 Apr 2007 08:30:41 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: perl OOP
Message-Id: <slrnf19cth.h89.abigail@alexandra.abigail.be>
Xiong Changnian (please@nospam.net) wrote on MMMMCMLXV September MCMXCIII
in <URL:news:please-CFEA97.20123504042007@free.teranews.com>:
??
?? More to the point, perhaps, do you think the distinction benefits OP?
Replies made here are not made just for the sake of the poster who started
the thread. If your reply was just for the sake of the OP, and noone else,
you should have used email. Instead, you post on a public forum stating
that 'new' is by definition for object construction. This isn't true, and
there are modules out there that don't use 'new'.
My correction was for the benefit of everyone who had read your post, which
probably means more people than just the OP.
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Thu, 05 Apr 2007 06:08:57 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: perl OOP
Message-Id: <m2abxn3zgm.fsf@local.wv-www.com>
Xiong Changnian <please@nospam.net> writes:
> In article <i3f713l00poscie90manl55s6s9tufsm4o@4ax.com>,
> Michele Dondi <bik.mido@tiscalinet.it> wrote:
>
>> ...can I suggest you try to condense it some more?
>
> I've never been good at that.
You could have stopped there.
Honestly - you're verging on at least one killfile. You seem to know your
Perl pretty well, but wading through 70+ lines of babble to get to two
or three lines of meaningful content is just too much. You're writing use-
net messages here, not your master's thesis. Get to the point.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 05 Apr 2007 06:18:47 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: perl OOP
Message-Id: <m2648b3z08.fsf@local.wv-www.com>
Xiong Changnian <please@nospam.net> writes:
> In article <m2vegcmjrl.fsf@local.wv-www.com>,
> Sherm Pendley <spamtrap@dot-app.org> wrote:
>
>> The point is that you're wrong.
>
> Well, I really don't believe so.
It's not a matter of belief. "By definition" has a meaning. New() is not
a constructor by definition, it's commonly used as such by convention.
You were wrong. Get over it.
> I don't think it serves any good
> purpose, either to root at my words or for me to shore them up.
You used the term incorrectly. How is someone less familiar with Perl to
know that? Someone who doesn't know better may be misled into believing
that new() is in fact defined as the standard constructor for Perl, when
there is no such definition.
> You know *exactly* what the relationships are among the concepts "new",
> "object constructor", "used to make a new object", and "class method". I
> don't doubt it in the least. Do you truly think I don't have a good
> handle on this as well?
None of that is relevant. We're discussing your use of the term "by defi-
nition" here, not your understanding of OOP in Perl.
> Or do you just feel that you would not have
> phrased the matter as I did?
It's not a feeling, nor an opinion. I know for a fact that you phrased it
incorrectly.
> More to the point, perhaps, do you think the distinction benefits OP?
In fact, it does. What benefit do you see in misleading him with incorrect
advice? (Or endless off-topic babbling, for that matter?)
> I'd really rather
... here we go with the long-winded off-topic rant. I stopped reading at
this point. If I wanted to read a book, I wouldn't be on usenet right now.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 05 Apr 2007 04:06:13 -0700
From: Xiong Changnian <please@nospam.net>
Subject: Re: perl OOP
Message-Id: <please-3E6693.04061305042007@free.teranews.com>
In article <m2648b3z08.fsf@local.wv-www.com>,
Sherm Pendley <spamtrap@dot-app.org> wrote:
> It's not a matter of belief. "By definition" has a meaning.
Okay. Direct me to the page of the Camel Book where this phrase ("by
definition") is defined. If you can do this, I will bow to your
superiority.
Otherwise, I maintain that I'm entitled to use it in the sense of "by my
current definition", "defined in this case", or "as hereby defined" and
if you don't like that, you're quibbling with my English, not my Perl,
and you need to go to another newsgroup to beat me up. Tell me when you
take this thread there, because I will gladly stand my ground -- there.
Done.
--
Xiong Changnian
xiong102ATxuefangDOTcom
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Thu, 05 Apr 2007 04:19:40 -0700
From: Xiong Changnian <please@nospam.net>
Subject: Re: perl OOP
Message-Id: <please-69BA75.04194005042007@free.teranews.com>
In article <slrnf19cth.h89.abigail@alexandra.abigail.be>,
Abigail <abigail@abigail.be> wrote:
> My correction was for the benefit
> of everyone who had read your post...
Was it really? Because I'm starting to get the distinct impression that
a majority of posts to this group are made to trash the egos of other
posters, without regard for topic or eventual clarity. Newcomers are
scathingly attacked for failure to read docs and others' posts are
searched for the least deviation from convention, there to be pilloried
and beaten to a pulp. This obsessive deconstruction serves nobody who
seeks information.
Now I remember why I departed the world of engineering, eventually to
arrive in education. My students do not expect me to be 100% accurate
and 100% precise, 100% of the time; indeed, they accept it when I tell
them that it is both undesirable and impossible to so be. My colleagues
do not require the explanation; they take it as a matter of course.
I still get the occasional engineering client. I have found that
technical proficiency is not prized one-half so highly as clarity,
courtesy, and fulfillment of the client's actual needs. I have never yet
met a client who cares whether I am right about anything.
Done, done, and done.
--
Xiong Changnian
xiong102ATxuefangDOTcom
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Thu, 05 Apr 2007 07:43:42 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: perl OOP
Message-Id: <m2k5wr2gi9.fsf@local.wv-www.com>
Xiong Changnian <please@nospam.net> writes:
> In article <m2648b3z08.fsf@local.wv-www.com>,
> Sherm Pendley <spamtrap@dot-app.org> wrote:
>
>> It's not a matter of belief. "By definition" has a meaning.
>
> Okay. Direct me to the page of the Camel Book where this phrase ("by
> definition") is defined.
The Camel documents Perl, not English.
By Definition:
"According to prior determination, as a given."
by definition. (n.d.). The American HeritageŽ Dictionary of Idioms by
Christine Ammer. Retrieved April 05, 2007, from Dictionary.com
website: http://dictionary.reference.com/browse/by definition
Neither the Camel, nor any other Perl documentation, defines new() as the
standard constructor method that all classes must use. It use as such is
neither predefined, nor a given. It's purely a matter of convention, and
so describing it as a constructor "by definition" is misleading.
> Otherwise, I maintain that I'm entitled to use it in the sense of "by my
> current definition", "defined in this case", or "as hereby defined" and
Of course you're entitled to be wrong. It's a free net.
> if you don't like that, you're quibbling with my English, not my Perl
I'm not quibbling, I'm trying to prevent you from misleading newbies who
might be coming from a language where new *is* a predefined keyword with
a given meaning and therefore, by definition, the standard way to construct
an object in those languages.
> Done.
Good - correcting your mistake is growing tiresome.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 05 Apr 2007 07:52:21 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: perl OOP
Message-Id: <m2fy7f2g3u.fsf@local.wv-www.com>
Xiong Changnian <please@nospam.net> writes:
> In article <slrnf19cth.h89.abigail@alexandra.abigail.be>,
> Abigail <abigail@abigail.be> wrote:
>
>> My correction was for the benefit
>> of everyone who had read your post...
>
> Was it really?
Yes it was, really.
> Because I'm starting to get the distinct impression that
> a majority of posts to this group are made to trash the egos of other
> posters, without regard for topic or eventual clarity.
Rubbish. Clarifying your incorrect statement was exactly the point. Your
ego is your problem - if you can't stand being corrected without taking it
personally, you really shouldn't try to discuss technical issues. We value
precision over warm fuzzy feelings here.
> Newcomers are scathingly attacked
... yet another long-winded rant.
I give up. You may have some Perl knowledge worth sharing, but finding it
in the volumes of irrelevant babble just isn't worth it.
*plonk*
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 05 Apr 2007 14:01:34 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl OOP
Message-Id: <nhn913hi1fapfbd64h7dqtrpu0nbo0uomn@4ax.com>
On Wed, 04 Apr 2007 19:46:35 -0700, Xiong Changnian
<please@nospam.net> wrote:
>> ...can I suggest you try to condense it some more?
>
>I've never been good at that. For one thing, whenever I *do* try to be
Me neither.
I always tried. I always failed.
Don't complain. Try again. Fail again.
Fail better.
>terse, someone always seems to sideswipe me with the sort of nitpicking
>to which I latterly objected. Personally, I think it should not be
One thing is to be terse and one thing is to be imprecise, to the
point of saying something that is actually wrong. Or that may be
understood in a wrong manner. Sometimes one goes the second route to
the effect of obtaining a "first order approximation". Sometimes it is
appropriate. Generally it isn't. When it is, a small reminder that
this is the case is in order, along the lines of "this is not *really*
so, but..."
>In the example, OP was (I believe) stumbling around in the deep dark,
>not understanding why new should be a class method. It will be some time
In this example the OP was (everyone can see) stubling around in the
deep dark, period.
>English is ambiguous; that's why we don't program in it. I think it's a
>bit silly to hammer anyone for a written English statement that doesn't
>appear to reflect the wisdom that one feels must be emphasized.
: If I convert a program into English, I don't get Shakespeare, but
: Cobol. A subset of English fit for morons and guaranteed not to make
: use of its expressive powers.
: - David Kastrup in comp.text.tex, "Re: pdflatex or dvipdf ?"
;-)
>I really do apologize if you find me verbose. My current career consists
>largely of saying the same thing over and over, in the greatest possible
>detail.
Yet, I'm convinced you should take my advice seriously. Style *does*
matter. I know those whose posts I want to read here not only because
I know in advance they are knowledgeable, but also because I know in
advance I will enjoy reading them, since they will won't make me loose
any time. I could name a few, but I bet you know as well. As a
newcomer here, I would read *all* posts by Benjamin Goldberg, who was
a regular back then, even if the subject was not interesting to me: I
knew they would have been instructive anyway.
>By the way, I tried to email you privately to thank you for my new sig:
I posted it in a "crypted" form here not long ago. Some idio^Wgenius
even discrambled it and posted it in clear.
>Amateurs built Noah's Ark.
>Professionals built The Titanic.
I stole it from someone else's sig in PM...
Sometimes I do copy other people's .sig's. But generally I like to
make my own out of witty comments I find in ng's, ml's and web forums.
Hereafter are some. (Probably not all, because I have never
"standardized" the way I write them.)
(Just a list of quotes and nothing else below.)
$ perl -lpe '$_="_" x 70 if $_ eq "-- "' $(grep -li "clpmisc"
.signature-*)
______________________________________________________________________
Abigail <abigail@abigail.nl> wrote in comp.lang.perl.misc:
...never mind what. Welcome back!
- Anno Siegel in clpmisc, "Re: Localised sub?"
______________________________________________________________________
Since <=> is the space ship operator, what about calling => the
damaged space ship operator?
- Abigail in clpmisc, "Re: What do you call the => operator?"
______________________________________________________________________
Either of these mechanisms should be available in IE (after
sacrificing a suitable animal to XP SP2, I suppose).
- Alan J. Flavell in clpmisc, "Re: character encoding in CGI.pm"
______________________________________________________________________
> That aside, let them ask, don't assume they're stupid
When they're asking a question that's answered inside of five minutes
by
reading the available docs, it's not an assumption.
- Sherm Pendley in clpmisc, "Re: Any good Perl coders out there?"
______________________________________________________________________
> sub printpages
> {
> return;
> }
This sub is the best code you have written so far.
- A. Sinan Unur in clpmisc, "Re: Free source guestbook - unfinished"
______________________________________________________________________
you need a brain hack. or a brain of any sort. try a nematode first.
the
small incremental improvement won't be such a shock. then you can
graduate to segmented worm brains.
- Uri Guttman in clpmisc, "Array Sort Using Regex Matching Fails"
______________________________________________________________________
Chuck Norris can indent a Python program any way he wants, and it
still works.
- Randal L. Schwartz in clpmisc, "Re: Python has a new Logo".
______________________________________________________________________
> 4 words: it-was-a-joke!
4 words: he-has-no-clue!!
- Uri Guttman in clpmisc (slightly edited)
______________________________________________________________________
Oh, come on. There must be some Cobol poetry. Something long
and impenetrable, in hexameter...
- Anno Siegel in clpmisc, "Re: perl to english"
______________________________________________________________________
"Each language has its purpose, however humble. Each language
expresses
the Yin and Yang of software. Each language has its place within the
Tao.
But do not program in COBOL if you can avoid it."
- Octo Mancer in clpmisc
______________________________________________________________________
Have you ever stopped to consider that what is crashing
your Perl is sitting between the keyboard and chair?
- Sherm Pendley in clpmisc, "Re: Perl IDE" (edited)
______________________________________________________________________
> Ooooh... a code critique.
Ooooh... a spelling critique.
- John W. Krahn in clpmisc, "Re: backup utility for remote hosts"
______________________________________________________________________
STOP FRIGGIN' DOING THAT. In the first place, no one here is ASKING
to
see your scripts - you're posting these of your own accord, much like
a
cat putting a dead mouse on the door, hoping we all say "ohhh, isn't
that
wonderful!".
- Paul Lalli in clpmisc, "Re: free source authentication script"
______________________________________________________________________
> $ENV{'SERVER_NAME'} this indentifies a server name
> $ENV{'SCRIPT_NAME'} this indentifies a script name
> does anyone know what code would be used to indentify the url used to
> access a site?
$ENV{'rectal discharge'}
- Tad McClellan in clpmisc, "Subject: Re: $ENV{'URL'}"
______________________________________________________________________
> Having taken a look at that: bleech.
Thanks for the constructive feedback Ben. :-)
- Paul Marquess to Ben Morrow in clpmisc
______________________________________________________________________
i've a grand scheme for a means for users to mail the authors of
packages, which would be useful for users who want their mail address
hidden. the problem with grand schemes is all those little devils
that squirm out of the details...
- Robin Fairbairns in clpmisc, "Re: CTAN has a new package: cool"
______________________________________________________________________
> but would love any recommendations that people might have in terms of IDE.
> i far prefer it to command line world.
Beware the IDEs of March...
- Matt Garrish in clpmisc, "Re: open-perl-ide qustion"
______________________________________________________________________
No one can ever predict all of the possible error conditions, of
course;
as soon as we write idiot-proof code, along comes a better idiot.
But it's still worth making the attempt.
- Sherm Pendley in clpmisc (edited)
______________________________________________________________________
"a few lines of code" and "prevent it from being insecure" should
not appear in the same sentence.
- Tad McClellan in clpmisc, "Re: free source for bbs"
______________________________________________________________________
Yesterday I was in doubt whether to add you to my killfile.
Today, I no longer have that doubt.
- Alan J. Flavell in clpmisc, "Re: short script differences"
______________________________________________________________________
...and when you're done, don't be surprised if your boss - or even the
customer for whom you're creating the application - haven't heard
about
the language of your choice and insists that you write it in a
language
which everyone has heard about, but that's not really suitable for the
problem. :)
- Tore Aursand in clpmisc, "Re: Perl neq Python"
______________________________________________________________________
I've now learned language design is the same as government and
sausage,
you really don't want to see what goes into it.
- Jeff Stampes in clpmisc, "Re: XS Progamming with Perl 6".
______________________________________________________________________
And: Every book which has a title that promises you to learn
something in
x weeks, day or even hours is lying.
- Tore Aursand in clpmisc, "Re: wow...jackpot."
______________________________________________________________________
> I don't think I'm going to
> make it a regular stop on my information super highway.
The loss to this community will be great, but thank you for doing
what you can to make this a better place.
- Tad McClellan in clpmisc, "Re: Perl and Politics".
______________________________________________________________________
'Most any OS will also support either read(2) or some equivalent. Most
support read(2) directly: Win32 does, though it also has its own set
of functions, in the classic Microsoft fashion of not doing a thing
well once when you can do it badly five times.
- Ben Morrow in clpmisc, "Re: Perl's read() vs. sysread()"
______________________________________________________________________
>if I insert a big number (like 10000000), perl uses about 300MB of memory. Why?
I'm a moron. Definitely a moron. Sorry
- "Sandrino" in clpmisc (slightly edited),
"Re: perl 5.8.3 on windows XP eat an huge amount of memory?"
______________________________________________________________________
> I'm starting my own cult to exterminate morons on this earth.
Sounds suicidal to me,
- Stefan Monnier in clpmisc & elsewhere, "Re: Larry Wall & Cults"
______________________________________________________________________
> Your right, I didn't think of that at all, but still, who's gonna go into
> the temp internet folder and create a cookie? At least not most users.
Of course *most* users aren't going to do that. *Most* users aren't
trying to hack your site! You don't program securely for *most* users
-
you program securely for the few users who *are* trying to be
malevolent.
- Paul Lalli in clpmisc, "Re: free source authentication script"
______________________________________________________________________
no you don't. you won't. try banging your head against your
keyboard. you will be nebulous soon.
- Uri Guttman in clpmisc, "Re: Regexp slowdown".
______________________________________________________________________
FWIW, whenever anyone claims a Perl core bug, the first thing I
suspect
is a hardware issue (probably a loose nut behind the keyboard).
- David Filmer in clpmisc, 'Re: A possable bug in the "warnings"
pragma.'
______________________________________________________________________
> - if using perl on Unix isn't that simple as on PCs
It is not PC to use "PC" to mean "Windows box". :-)
- Brian McCauley in clpmisc, "Re: Using perl over network (NFS)"
______________________________________________________________________
The easy step is writing a browser that understands inline Perl.
The difficult step is to convince people to use your browser
instead of IE, Netscape or whatever they use now.
- Abigail in clpmisc, "Re: How to use a web broser as GUI"
______________________________________________________________________
The value of a hash in scalar context is not of interest to
a Perl programmer, it is only of interest to a perl programmer.
- Tad McClellan in clpmisc, "Re: Question on loops and return values"
______________________________________________________________________
> Comments should say _why_ something is being done.
Oh? My comments always say what _really_ should have happened. :)
- Tore Aursand in clpmisc
______________________________________________________________________
He "steals".
You "reuse".
I "enhance the value of".
- "Alex" in clpmisc (slightly edited)
______________________________________________________________________
You have basically written Java in Perl. There is a reason we program
in
Perl. If I wanted to program in Java, which I still occasionally do, I
would just go ahead and program in Java.
- A. Sinan Unur" in clpmisc.
______________________________________________________________________
Oh, for God's sake! Earnest misunderstanding I can cope with,
stupidity I can cope with, complete lack of sense of humour I can cope
with, but lying I cannot.
*PLONK*
- Ben Morrow in clpmisc (slightly edited)
______________________________________________________________________
: I've actually fixed the security glitches now
Bullshit. Security is designed into a product. Your design is
inherently
insecure. This is not something you can fix by pecking in a few more
lines
of code.
- Jay Tilton in clpmisc, "Re: free source for bbs"
______________________________________________________________________
> I was wondering if there is someone who knows a good perl spam filter.
That's funny. Most of my spam is for v1agr4 and p3nis 3nl@rg3ment, not
Perl.
- John J. Trammell in clpmisc, "Re: Perl Spam Filter" (slightly
edited)
______________________________________________________________________
and get perl on your own box and test it there. relying on
uploading to test perl is like using stilts to ice skate.
- Uri Guttman in clpmisc, "Re: Can't change filenames..why?"
______________________________________________________________________
> You can't fix an issue by causing a bigger one.
Tell that to Bush. ;-)
- John W. Krahn in clpmisc, "Re: LWP::UserAgent question".
______________________________________________________________________
> (I don't know why I can't resist jumping in on this thread. I wonder if
> it's a mass hypnosis worm ...)
It must be the usenet equivalent of a spectacular car crash, where
passersby feel compelled to stop and stare.
- Keith Keller in clpmisc, "Re: Clarifications"
______________________________________________________________________
I think it's a usenet law - any rant about an error in someone else's
message
will inevitably have one such error in the rant itself. :-)
- Sherm Pendley in clpmisc, "Re: Want to create a website using perl
and CGI".
______________________________________________________________________
QueryPerformanceCounter returns a 64-bit integer... but the frequency
and base change from machine to machine, and boot to boot.
- Ben Liddicott in clpmisc, "Re: pack, Win32 registry & binary data"
______________________________________________________________________
throw yourself somewhere and... Xah.flush()
- G. M. Tagliaretti answering to Xah Lee's
trolling in clpmisc _and_ clpy.
______________________________________________________________________
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling in clpmisc,
"perl bug File::Basename and Perl's nature"
______________________________________________________________________
I haven't yet seen a "Teach yourself X in Y" book that was worth the
lives
of the trees that died to make it. I'm not the least bit surprised
that the
authors of such books are weak on the concepts - in fact I'd be
shocked if
they weren't.
- Sherm Pendley in clpmisc, "Re: Want to create a website using perl
and CGI"
______________________________________________________________________
I agree with Tore; it's sort of a Zen question.
If you have to ask, it means you won't understand the answer.
If you know enough to understand the answer, you won't need the
question.
- Joe Smith in clpmisc, "Re: Perl neq Python"
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 5 Apr 2007 09:59:22 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Problem installing Errno
Message-Id: <1175759962.868971@proxy.dienste.wien.at>
Sherm Pendley:
> Installing an update from CPAN without using UNINST=1 will leave the core
> version in place, and since the core module directory precedes the site
> directory, the core module will be what's found when you use() it. The
> UNINST=1 option prevents this by deleting older core versions when you
> replace them with newer non-core versions of the same module.
Many thanks for this explanatation! This solves some problems I had
when installing from CPAN some time ago.
Is this behaviour documented somewhere?
Greetings, Ferry
--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at
------------------------------
Date: Thu, 05 Apr 2007 06:47:34 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Problem installing Errno
Message-Id: <m2wt0r2j3t.fsf@local.wv-www.com>
"Ferry Bolhar" <bol@adv.magwien.gv.at> writes:
> Sherm Pendley:
>
>> Installing an update from CPAN without using UNINST=1 will leave the core
>> version in place, and since the core module directory precedes the site
>> directory, the core module will be what's found when you use() it. The
>> UNINST=1 option prevents this by deleting older core versions when you
>> replace them with newer non-core versions of the same module.
>
> Many thanks for this explanatation! This solves some problems I had
> when installing from CPAN some time ago.
>
> Is this behaviour documented somewhere?
I would think so, but to be honest I couldn't find it. I first noticed it
when a "make install" complained about the newly installed module being
"shadowed" by the core version, and suggested using "UNINST=1" to prevent
that from happening. (I'm off to download the latest Perl, and submit a
docs patch if it's still not there - this should really be documented in
ExtUtils::MakeMaker.)
Note that "UNINST=1" is the option to use for ExtUtils::MakeMaker based
modules. For those that use Module::Build - they have a Build.PL instead of
a Makefile.PL - the option is called "--uninst=1".
You can set the relevant options in the CPAN shell like this:
o conf make_install_arg UNINST=1
o conf mbuild_install_arg --uninst=1
o conf commit
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 5 Apr 2007 11:50:05 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <slrnf19hid.av8.hjp-usenet2@yoyo.hjp.at>
On 2007-04-03 17:06, xhoster@gmail.com <xhoster@gmail.com> wrote:
> bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>> I'm just trying to optimise some code.
>>
>> So I'm using profiling.
>>
>> Sadly, I'm missing a facility I'm used to in
>> common 'C'; profilers.
>>
>> I know (in my real code) I'm spending
>> most of my time in a common subroutine.
>>
>> However, this subroutine is already "fast",
>> and would be difficult to make faster.
>>
>> So what I need to know is - who's calling it,
>> so I might be able to reduce the number
>> of times it's called.
>
> Why do you want to know that? Since you already know it is as fast
> as you can make, just ignore it.
While each individual call may be as fast as possible, it may be called
more often than necessary. Some examples:
* A function is called in a loop although its return value is invariant.
Then you can call the function just once before the loop.
* You have a complex comparison function, which is used to sort a large
arrays. Instead of calling the comparison function on every comparison
you can instead convert each element to a sortable string
representation once, which essentially reduces O(n log n) to O(n).[0]
* You may have a highly optimized function for retrieving a single
record from a database. But if you need to fetch 5000 records, it
doesn't make sense to call this function 5000 times - instead call a
function which fetches 5000 records in a single select.
Things like this are easy to miss, and a tool which tells you that
function A is called by function B 57345 times can help you to find
them.
hp
[0] I realize this isn't correct, but the details aren't important
for this example.
--
_ | Peter J. Holzer | Blaming Perl for the inability of programmers
|_|_) | Sysadmin WSR | to write clearly is like blaming English for
| | | hjp@hjp.at | the circumlocutions of bureaucrats.
__/ | http://www.hjp.at/ | -- Charlton Wilbur in clpm
------------------------------
Date: Thu, 05 Apr 2007 09:43:41 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Testing against a list of values ?
Message-Id: <ev29ls$eqb$1@mlucom4.urz.uni-halle.de>
- Bob - wrote:
> I coded the following, which works but is lengthy:
>
> if ( ($temp ne "a")
> and( $temp ne "x" )
> and ( $temp ne "y" ) ){ ....}
>
> What's a more Perl-like and compact way to code something like this ?
Depending on your real intend (check only
characters - or longer strings), I'd saythat 'grep'
would be 'perlish' (solution already posted by others)
You could make it 'more descriptive' by wrapping it
into a subroutine, like
...
sub NOT_IN { ! grep $_[0] =~ /$_/, @_[1..@_-1] }
my $temp ="bz";
if ( NOT_IN $temp => qw' a x y ' ) {
print "$temp doesn't contain one\n"
# ....
}
...
Regards
M.
------------------------------
Date: Thu, 5 Apr 2007 10:33:48 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Testing against a list of values ?
Message-Id: <ev2jef.1a4.1@news.isolution.nl>
- Bob - schreef:
> I coded the following, which works but is lengthy:
>
> if ( ($temp ne "a")
> and( $temp ne "x" )
> and ( $temp ne "y" ) ){ ....}
>
> What's a more Perl-like and compact way to code something like this ?
For example
/^[axy]$/
or
/^(?:a|x|y)$/
where the latter has room for longer values. You can mix'm too:
if ( $temp =~ m!^(?: [ny] | no | yes )$!x ) {...}
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 05 Apr 2007 08:57:13 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: Testing against a list of values ?
Message-Id: <4614b9e9$0$21841$db0fefd9@news.zen.co.uk>
On Wed, 04 Apr 2007 23:33:37 GMT, - Bob - <uctraing@ultranet.com> wrote:
> I coded the following, which works but is lengthy:
>
> if ( ($temp ne "a")
> and( $temp ne "x" )
> and ( $temp ne "y" ) ){ ....}
>
> What's a more Perl-like and compact way to code something like this ?
>
Another possibility is to use a hash.
my %valid_value = map { $_ => 1 } qw( a x y );
if ( $valid_value{ $temp } ) {
# ...
}
------------------------------
Date: 05 Apr 2007 10:31:59 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Testing against a list of values ?
Message-Id: <slrnf19k0v.i01.abigail@alexandra.abigail.be>
- Bob - (uctraing@ultranet.com) wrote on MMMMCMLXIV September MCMXCIII in
<URL:news:jkc813d97s5kg5t3q0r9c8tm4hak44sieh@4ax.com>:
&& I coded the following, which works but is lengthy:
&&
&& if ( ($temp ne "a")
&& and( $temp ne "x" )
&& and ( $temp ne "y" ) ){ ....}
&&
&& What's a more Perl-like and compact way to code something like this ?
It depends on what you want to optimize.
If you want compactness, I'd write:
if ($temp !~ /^[axy]$/) {
...
}
If you want to maximize clearness:
if ($temp ne "a" and
$temp ne "x" and
$temp ne "y") {
....
}
or
unless ($temp eq "a" or
$temp eq "x" or
$temp eq "y") {
...
}
If you want to maximize configurability (in the program itself):
#
# Somewhere near the top of the program.
#
my %answers = map {($_ => 1)} qw [a x y];
...
if (!$answers {$temp}) { # Or 'unless'.
...
}
I use all three, depending on what I want to optimize, my mood, and
the phase of mars.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
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 306
**************************************