[29054] in Perl-Users-Digest
Perl-Users Digest, Issue: 298 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 16:19:29 2007
Date: Tue, 3 Apr 2007 13:19:22 -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 Tue, 3 Apr 2007 Volume: 11 Number: 298
Today's topics:
Re: Problem in the Perl script <bik.mido@tiscalinet.it>
Re: Problem in the Perl script <afmcc@btinternet.com>
Re: Problem in the Perl script <jurgenex@hotmail.com>
Re: Problem in the Perl script <bik.mido@tiscalinet.it>
Re: Problem in the Perl script <hjp-usenet2@hjp.at>
Re: Problem in the Perl script <bik.mido@tiscalinet.it>
Re: Problem in the Perl script <spamtrap@dot-app.org>
Re: Problem in the Perl script <please@nospam.net>
Re: Problem in the Perl script <bik.mido@tiscalinet.it>
Re: Problem in the Perl script <uri@stemsystems.com>
Re: profiling - analyse by time "on behalf of"? <bugbear@trim_papermule.co.uk_trim>
Re: profiling - analyse by time "on behalf of"? <bugbear@trim_papermule.co.uk_trim>
Re: profiling - analyse by time "on behalf of"? xhoster@gmail.com
Re: profiling - analyse by time "on behalf of"? <rvtol+news@isolution.nl>
Re: profiling - analyse by time "on behalf of"? xhoster@gmail.com
Re: Trailing whitespace question <bik.mido@tiscalinet.it>
Re: wget with CPAN <spamtrap@dot-app.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 03 Apr 2007 10:35:45 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem in the Perl script
Message-Id: <mt3413t8lhfr87jelhbecnja2pbvo7iu9q@4ax.com>
On Mon, 02 Apr 2007 13:05:31 -0700, Xiong Changnian
<please@nospam.net> wrote:
>Often it's a useful approximation. Sometimes it's not. There is no
>obvious, blatant, and exact analogy to floats in the real world, so when
>I can, I settle for obvious, blatant, and inexact.
In the real world... first or later you have to cope with the
philosophy of physics and mathematics. Do reals really exist? :-) In
my reply to your post I wanted to include a quote from a famous
mathematician (although I can't remember exactly which one, although I
can make a few guesses) to the effect of something along the lines of
"God created integers, all else is work of men": actually I had read
it as an epigraph in a book I don't have available at the moment and
it was in German. I don't know German, but it was quite
understandable, something along the lines of "Gott *** die zahlen, alt
else ist menshenwerke." (Apologies to German fellows out there.) I
wanted to locate it to report it appropriately, but Google didn't
help...
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: Tue, 03 Apr 2007 10:16:13 +0100
From: Tony Mc <afmcc@btinternet.com>
Subject: Re: Problem in the Perl script
Message-Id: <5o641394ql2vqj7r6ug50di63rcmjlqbnb@4ax.com>
On Tue, 03 Apr 2007 10:35:45 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
> In the real world... first or later you have to cope with the
> philosophy of physics and mathematics. Do reals really exist? :-) In
> my reply to your post I wanted to include a quote from a famous
> mathematician (although I can't remember exactly which one, although I
> can make a few guesses) to the effect of something along the lines of
> "God created integers, all else is work of men": actually I had read
> it as an epigraph in a book I don't have available at the moment and
> it was in German. I don't know German, but it was quite
> understandable, something along the lines of "Gott *** die zahlen, alt
> else ist menshenwerke." (Apologies to German fellows out there.) I
> wanted to locate it to report it appropriately, but Google didn't
> help...
Leopold Kronecker, I think.
Tony
------------------------------
Date: Tue, 03 Apr 2007 12:06:33 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Problem in the Perl script
Message-Id: <drrQh.1474$yL1.1351@trndny04>
Michele Dondi wrote:
> it was in German. I don't know German, but it was quite
> understandable, something along the lines of "Gott *** die zahlen, alt
> else ist menshenwerke." (Apologies to German fellows out there.)
Leopold Kronecker 1823-1891: "Die ganzen Zahlen hat der liebe Gott gemacht,
alles andere ist Menschenwerk."
http://de.wikipedia.org/wiki/Leopold_Kronecker
jue
------------------------------
Date: Tue, 03 Apr 2007 14:06:21 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem in the Perl script
Message-Id: <gng4135vmirvsjjn6b19hu9agb6ql2ekmd@4ax.com>
On Tue, 03 Apr 2007 10:16:13 +0100, Tony Mc <afmcc@btinternet.com>
wrote:
<ot>
>Leopold Kronecker, I think.
Yep, I think so too. Do you have the full, actual, precise quote? I
tried with some IMHO reasonble search like
<http://www.google.com/search?q=kroenecker+zahlen+menshenwerke+quote>,
but could not find one. I would put it amongst my .sig's...
</ot>
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: Tue, 3 Apr 2007 15:21:02 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Problem in the Perl script
Message-Id: <slrnf14l5u.1od.hjp-usenet2@yoyo.hjp.at>
On 2007-04-03 12:06, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Tue, 03 Apr 2007 10:16:13 +0100, Tony Mc <afmcc@btinternet.com>
> wrote:
><ot>
>>Leopold Kronecker, I think.
>
> Yep, I think so too. Do you have the full, actual, precise quote? I
> tried with some IMHO reasonble search like
><http://www.google.com/search?q=kroenecker+zahlen+menshenwerke+quote>,
Surprisingly, Google does suggest the correct spelling:
Meinten Sie: kronecker zahlen menschenwerke quote
but still finds nothing. After removing "quote" from the search string
it does find two instances of the quote. ("Menschenwerk" finds a lot
more than "Menschenwerke", as the latter is wrong in modern German (and
may be a misquote by non-German speakers)
hp
--
_ | 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: Tue, 03 Apr 2007 16:28:17 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem in the Perl script
Message-Id: <23p413ltg4db9u7iknv2n9pa9sjvfcqapp@4ax.com>
On Tue, 03 Apr 2007 12:06:33 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:
>> it was in German. I don't know German, but it was quite
>> understandable, something along the lines of "Gott *** die zahlen, alt
>> else ist menshenwerke." (Apologies to German fellows out there.)
>
>Leopold Kronecker 1823-1891: "Die ganzen Zahlen hat der liebe Gott gemacht,
>alles andere ist Menschenwerk."
TY, and apologies again for the slaughter committed on your language!
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: Tue, 03 Apr 2007 12:13:59 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Problem in the Perl script
Message-Id: <m23b3hpha0.fsf@local.wv-www.com>
Michele Dondi <bik.mido@tiscalinet.it> writes:
> On Tue, 03 Apr 2007 10:16:13 +0100, Tony Mc <afmcc@btinternet.com>
> wrote:
>
> <ot>
>>Leopold Kronecker, I think.
>
> Yep, I think so too. Do you have the full, actual, precise quote?
According to his Wikipedia bio, for what that's worth, it's "God made the
integers; all else is the work of man."
<http://en.wikipedia.org/wiki/Leopold_Kronecker>
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Tue, 03 Apr 2007 09:34:31 -0700
From: Xiong Changnian <please@nospam.net>
Subject: Re: Problem in the Perl script
Message-Id: <please-B9D416.09343103042007@free.teranews.com>
In article <mt3413t8lhfr87jelhbecnja2pbvo7iu9q@4ax.com>,
Michele Dondi <bik.mido@tiscalinet.it> wrote:
> Do reals really exist?
Probably not; the evidence seems to be leaning the other way. It's very
hard to say and perhaps will always lie, with most cosmology, in the
realm of faith. I certainly prefer discrete models.
This is among the earliest philosophical questions to be raised.
Democritus and Leucippus advocated a theory of indivisible /atoma/; the
discovery of subatomic particles has done nothing to upset this
position. Plato and Aristotle argued for infinite divisibility of the
universe: a continuum. Well, Aristotle also argued for heavier objects
falling faster.
My mother was a combinatorialist, so blame her if you like for my atomic
orientation. I'd venture that programmers in general side with atomists;
our tools are digital so we tend to believe in quanta. Perhaps if analog
computers had turned out to be cheap, compact, and reliable, we would
lean to a continuum.
The general public today seems to stand in the camp of the atomists. My
students often demand to know the "real", true value of pi; they are
unsatisfied with all explanations. It is said that the irrationality of
the diagonal of a unit square was a scandal and a guarded secret of the
Pythagoreans.
When I was young, I was such a stubborn atomist that I remarked to an
engineer my senior that I had no interest in electronics outside of
digital logic. Our project was an early CCD camera -- which, despite
such things being called "digital cameras" today, demand quite a bit of
analog TLC. I swaggered with a belly full of boolean truth. The senior
man said, "You'd better branch out. It's an analog world." It took me
years to believe him but I did eventually delve into transistor and
op-amp theory. Now, I'm one of a dwindling number of San Jose residents
who are willing to do small analog projects for clients.
I say all this to show that I see both sides of the issue. I think any
given problem may be best approached with a flexible blend of views. I
don't believe that any fixed rule or orientation makes for the best
solution.
We've all heard the story of the IBM interview question: "Why are
manhole covers round?" I first heard it from my father, who failed to
land the job. When I ask it -- as I often do -- of my students, I'm
often surprised by how many just can't wrap their brains around the
basic requirement: to come up with a large number of inventive, perhaps
conflicting explanations. They fixate on the need -- expressly
disclaimed -- to discover the one "right" answer.
--
Xiong Changnian
xiong102ATxuefangDOTcom
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Tue, 03 Apr 2007 18:56:03 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem in the Perl script
Message-Id: <um1513dd1lejhtruvh1bs5t43k4qpta166@4ax.com>
On Tue, 03 Apr 2007 09:34:31 -0700, Xiong Changnian
<please@nospam.net> wrote:
>We've all heard the story of the IBM interview question: "Why are
>manhole covers round?" I first heard it from my father, who failed to
I hadn't. I didn't even know what "manhole" meant. Of course I do know
what a manhole is. I just didn't know the English word. I googled
around. You gave me some entertaining reading.
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: Tue, 03 Apr 2007 14:38:46 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Problem in the Perl script
Message-Id: <x7bqi5nw09.fsf@mail.sysarch.com>
>>>>> "XC" == Xiong Changnian <please@nospam.net> writes:
XC> Perl has no fixed-point numeric format. There are only integers and
XC> floats. If a variable has *ever* stored a non-integer value, it will
XC> want to use floating-point format.
i wouldn't use the word format there. perl uses a machine integer or
float inside an sv as appropriate and will convert from one to the other
on the fly.
look at perldoc perlguts for more. and Scalar::Utils has subs that can
tell you what type of data is in an SV.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 03 Apr 2007 09:35:55 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <461211eb$0$8731$ed2619ec@ptn-nntp-reader02.plus.net>
anno4000@radom.zrz.tu-berlin.de wrote:
> bugbear <bugbear@trim_papermule.co.uk_trim> wrote in comp.lang.perl.misc:
>> and 17% on behalf on "a".
>
> For a quick hack just to get the desired distribution, change the code
> so that you have two subs identical to s(), say s_a() and s_b(). Call
> one from a() and the other from b(), then you'll know.
My real code (which is inherited legacy) is sufficiently complex that I wouldn't
where to start with that approach.
BugBear
------------------------------
Date: Tue, 03 Apr 2007 09:36:33 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <46121212$0$8731$ed2619ec@ptn-nntp-reader02.plus.net>
Peter J. Holzer wrote:
> On 2007-04-02 11:38, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>> 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.
>>
>> So what I'd like to be able to do is group
>> the subroutine time by CALLER (or parent, if
>> you like).
> [...]
>> I would like a report that tells me that, of the time
>> spent in "s", 83% is spent working "on behalf of" b
>> and 17% on behalf on "a".
> [...]
>> So - does anyone know of a profiler or profile
>> analyser that will do an "on behalf of"
>> print for me?
>
> I don't know one, but have a look at perldoc Devel::DProf: The format
> of the tmon.out file looks simple enough that you should be able to
> extract the information you want.
Yeah, I took a peek before asking, and you're right.
I was just hoping not to have to re-invent a wheel.
BugBear
------------------------------
Date: 03 Apr 2007 17:06:39 GMT
From: xhoster@gmail.com
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <20070403130641.621$98@newsreader.com>
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. Go down the list to the next biggest
(sub-inclusive) bottleneck. That will almost surely be the one that calls
this sub a heck of a lot, right?
....
> Sadly, my real program is complex enough
> that the -I output is simply confusing :-(
I'm not at all confident that, if you got what you are asking for, you
would find it any less confusing than you find the -I output. I think
maybe you should put some more time into understanding the -I output before
giving up on it. I'd be game to help with that if you can describe both
what you see and what confuses you in more detail. I know that many times
I've looked at something, said "this is needlessly complex", and started
making my own version. In the process of doing so, I discovered that the
complexity wasn't in fact needless and the original thing I gave up on
made a lot more sense.
Also, you might want to try the -S option to dprofpp. Search the output
for the name of the suspected culprit, and it will tell you how many times
it was called by each caller, and go up a line to see who it was that
called it that number of times.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 3 Apr 2007 19:21:08 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <euu9gv.1ag.1@news.isolution.nl>
bugbear schreef:
> anno4000:
>> bugbear:
>>> and 17% on behalf on "a".
>>
>> For a quick hack just to get the desired distribution, change the
>> code
>> so that you have two subs identical to s(), say s_a() and s_b().
>> Call one from a() and the other from b(), then you'll know.
>
> My real code (which is inherited legacy) is sufficiently complex that
> I wouldn't where to start with that approach.
You could rename your s() to s_real() and let s() do some extra things
before and after calling s_real(), like collecting the caller() and the
HiRes start end end times. But first give Devel::DProf a try, as hp
mentioned.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 03 Apr 2007 19:36:20 GMT
From: xhoster@gmail.com
Subject: Re: profiling - analyse by time "on behalf of"?
Message-Id: <20070403153622.422$Xb@newsreader.com>
xhoster@gmail.com wrote:
>
> Also, you might want to try the -S option to dprofpp. Search the output
> for the name of the suspected culprit, and it will tell you how many
> times it was called by each caller, and go up a line to see who it was
> that called it that number of times.
Actually you have to go up to the line with one less level of indentation
to find the caller. That may require going up more than one line. So you
can't always get away with use "dprofpp -S | fgrep -B1 slow_culprit",
as I just learned.
But still, I think -S is very nearly what you want.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 03 Apr 2007 11:36:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Trailing whitespace question
Message-Id: <0u741352jmn20170u9qq70d9lq4po7qnd8@4ax.com>
On Mon, 02 Apr 2007 22:50:22 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
>Or
>
> unpack 'A4A20A30A8@70A8@103A20A1' => $_;
Or
unpack 'A4A20A30A8x8A8x25A20A1' => $_;
(And one would probably include some whitespace to improve
readability.)
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: Tue, 03 Apr 2007 12:08:03 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: wget with CPAN
Message-Id: <m27istphjw.fsf@local.wv-www.com>
"patrick" <ptri.c.k@stratsrev.corn> writes:
> While using CPAN to install some module groups, I often meet with failure
> when it attempts:
>
> Trying with "lynx -source" to get ...
>
> and then after some time gives up, and meets with success using "wget -O -
> ..."
>
> Is there a way to prevent trying to use lynx, and default to using wget?
In a cpan shell:
o conf lynx ''
o conf commit
Note that, if the value of the "lynx" config option is empty, CPAN will
*never* attempt to use Lynx - even if wget fails.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
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 298
**************************************