[31867] in Perl-Users-Digest
Perl-Users Digest, Issue: 3130 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 13 16:09:24 2010
Date: Mon, 13 Sep 2010 13:09:06 -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 Mon, 13 Sep 2010 Volume: 11 Number: 3130
Today's topics:
Re: How to pass hash as sub parameter? <rui.maciel@gmail.com>
Re: How to pass hash as sub parameter? <uri@StemSystems.com>
Re: How to pass hash as sub parameter? (Randal L. Schwartz)
Re: How to pass hash as sub parameter? <tzz@lifelogs.com>
Re: How to pass hash as sub parameter? <kst-u@mib.org>
Re: How to pass hash as sub parameter? <sherm.pendley@gmail.com>
Re: Ideal data structure for nested list format? sln@netherlands.com
Why Insulation is a Good Investment <sustainable.future116@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 12 Sep 2010 16:20:38 +0100
From: Rui Maciel <rui.maciel@gmail.com>
Subject: Re: How to pass hash as sub parameter?
Message-Id: <4c8cefc9$0$24464$a729d347@news.telepac.pt>
Sherm Pendley wrote:
> And yet, in all that time you *still* haven't learned the correct line
> width at which to wrap your posts?
You mean that old relic of the 80s when people insisted on the 76-character column so that they
could read a post on a Teletype? If you happen to use a Teletype to follow this NG then I offer you
my sincere sympathy for causing you so much grief. If not, maybe I should welcome you to the 90s,
where people managed to develop UIs which supported text fields that can easily wrap text.
> You *still* haven't learned to
> lurk a while first and read a group's FAQ & guidelines before posting
> to it?
This must be a zen thing, I guess. After all, how can you know how long a user has been lurking if,
as you suggested, he doesn't post any messages? You don't think things through, do you?
> Not the brightest bulb in the box, are ya?
For wasting my time replying to vacuous dunces who believe they do anyone any favours by trolling
newbies through useless, condescending messages? You got me there, I guess.
Rui Maciel
------------------------------
Date: Sun, 12 Sep 2010 12:11:27 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: How to pass hash as sub parameter?
Message-Id: <87sk1f7xhs.fsf@quad.sysarch.com>
>>>>> "RM" == Rui Maciel <rui.maciel@gmail.com> writes:
RM> Uri Guttman wrote:
>> learning a language is not a general search thing.
RM> You fail to understand the difference between "learning a
RM> language" and searching for information regarding a very specific
RM> subject. That's the fundamental role of search engines and the
RM> reason why search engines are the most sought-for services on the
RM> web.
you fail in learning a language. searching the web for language stuff is
the worst way to learn. there is too much garbage out there to sift
through and google does NOT rank quality of web tutorials. too many have
links to them which ranks them higher even though they are crap. if you
google for me in the perl usenet group you will find many reviews of
perl tutorials. the vast majority of them suck python dick. they are
buggy, incomplete, poorly written, use bad perl, etc. so that is what
you think is a good thing to google. your choice.
RM> Oddly enough, the very first document I read on perl was
RM> perl.com's beginner's introduction to Perl, which fails to mention
RM> such a fundamental aspect of Perl. So, if you happen to lurk this
RM> newsgroup to maintain that sort of info in perl.com then I have to
RM> say you have a lot of room to improve your contributions.
and did you even look at perldoc perl which shows perldoc perlsub which
covers all you needed to know? learning how to use docs is a skill. so
is usenet. learn them first. you have burned many potential bridges here
already. are you proud of that. you won't be getting help from some of
the best perl hackers around. a great accomplishment in such a short
time. this is all on your head, and you have no one to blame but
yourself.
RM> It's odd that you try to speak for others, as I've got plenty of
RM> helpful, constructive contributions from friendly users, which
RM> outnumbered the misanthropic trolls which tried to piss on this
RM> thread. So, as you are unable to post in a civilized manner then
RM> I suggest that you limit your participation on this newsgroup to
RM> digging for information to paste on the docs. You don't do anyone
RM> any good, let alone the Perl community, if you waste your time
RM> trolling newbies with condescending posts.
i help tons of people here. for many years. and in other areas i
contribute to the perl community. you know not of which you speak. you
are here asking for help but you pissed off many. the culture here has
existing for decades and you expect to come in and be spoon fed your
way? that isn't how the world or usenet works. grow up.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Sun, 12 Sep 2010 09:24:15 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to pass hash as sub parameter?
Message-Id: <86eiczc4ls.fsf@red.stonehenge.com>
>>>>> "Rui" == Rui Maciel <rui.maciel@gmail.com> writes:
Rui> You mean that old relic of the 80s when people insisted on the
Rui> 76-character column so that they could read a post on a Teletype?
Rui> If you happen to use a Teletype to follow this NG then I offer you
Rui> my sincere sympathy for causing you so much grief. If not, maybe I
Rui> should welcome you to the 90s, where people managed to develop UIs
Rui> which supported text fields that can easily wrap text.
I use GNU Emacs to read Usenet, via GNUS, which is equally adept at
reading nntp, email, or even making mailing lists appear to be
newsgroups for threading and filtering. Both GNU Emacs and GNUS are
modern, with very active development communities.
And yet, here I am, reading your post, and it annoyingly wraps, because
I have a fixed-width character buffer and it's set to 80 chars, which
happens to be a nice width to read for most people.
You, sir, are not paying attention to conventions. Why are you not
doing what *most* people wish you to do who want to read your text and
help you? It's silly to offend the very people from whom you want
assistance.
It's like we're saying "the line for help forms here, northward", and
you insist on coming along saying "but standing over here on the
southside, I get better sun!". Yeah, so what. The line forms
northward. You want help? Follow Usenet conventions.
Just another Usenet guy (from 1981, when it all started),
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Mon, 13 Sep 2010 10:27:23 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to pass hash as sub parameter?
Message-Id: <87vd69ek9w.fsf@lifelogs.com>
On Sun, 12 Sep 2010 01:02:40 +0100 Rui Maciel <rui.maciel@gmail.com> wrote:
RM> Thanks for the tip, Randal. It looks promising. Nevertheless, I've
RM> never heard of Moose before, which may quite possibly be due to the
RM> fact that I'm practically just starting out. So, do you happen to
RM> know if Mosse has been widely adopted or is it an obscure feature of
RM> Perl?
Moose is a whole ecosystem of modules that overlaps a lot with Perl 6's
feature set. It is popular and has a large community. At this year's
YAPC in Columbus (YAPC is a well-known Perl conference) Moose had many
talks and interest so I think it's a good bet for the near future (3
years or so).
It's not a Perl feature. AFAIK no Moose modules are bundled with Perl.
Ted
------------------------------
Date: Mon, 13 Sep 2010 11:49:43 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: How to pass hash as sub parameter?
Message-Id: <lny6b5h41k.fsf@nuthaus.mib.org>
Rui Maciel <rui.maciel@gmail.com> writes:
> Sherm Pendley wrote:
>> And yet, in all that time you *still* haven't learned the correct line
>> width at which to wrap your posts?
>
> You mean that old relic of the 80s when people insisted on the
> 76-character column so that they could read a post on a Teletype?
> If you happen to use a Teletype to follow this NG then I offer
> you my sincere sympathy for causing you so much grief. If not,
> maybe I should welcome you to the 90s, where people managed to
> develop UIs which supported text fields that can easily wrap text.
[...]
I, like many others, happen to read Usenet in a terminal emulator
with a fixed-width font and a width of 80 columns. For the vast
majority of articles I read here, that works just fine.
As for these UIs that "can easily wrap text", do you expect them
to distinguish between English text to be wrapped and Perl source
code to be left alone?
Please pause for just a moment and consider the possibility that
someone else might be right and you might be mistaken, or at
least that others might have rational reasons for their opinions
other than clinging to decades-old technology.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
------------------------------
Date: Mon, 13 Sep 2010 15:53:12 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: How to pass hash as sub parameter?
Message-Id: <m24odth13r.fsf@sherm.shermpendley.com>
Rui Maciel <rui.maciel@gmail.com> writes:
> If not, maybe I should welcome you to the 90s,
> where people managed to develop UIs which supported text fields
> that can easily wrap text.
Easily, that is, unless the text is *already* wrapped, in which case
they'll use the newlines in the text, *and* wrap lines that are longer
than the width of the text field.
No matter how you slice it, old-school or new-school, your posts are
full of epic fail.
> This must be a zen thing, I guess.
Not really, just the most logical conclusion based on the evidence
I've seen so far.
> After all, how can you know how long a user has been lurking if,
> as you suggested, he doesn't post any messages?
It's easy. Actions speak far louder than words; if you're acting like
an arrogant twit who hasn't lurked, hasn't read the FAQ, and takes
pride in his own ignorance, no one will believe you're anything else
no matter what experience you claim to have.
What's more, anyone who *does* believe such claims will then conclude
that your experience should have taught you how to behave better, so
your rudeness must therefore be intentional, rather than a newbie
mistake.
That leaves us with two choices: You're either lying or trolling. Which
is it? No matter; either way, I have only one word for you:
*PLONK*
sherm--
--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
------------------------------
Date: Sun, 12 Sep 2010 16:35:20 -0700
From: sln@netherlands.com
Subject: Re: Ideal data structure for nested list format?
Message-Id: <nloq86tn8r6hs5mu7oae6oa40844m7ieh2@4ax.com>
On Tue, 7 Sep 2010 23:56:17 +0200, Tuxedo <tuxedo@mailinator.com> wrote:
>
>True enough! I found a simple way to produce what is needed by importing an
>html list from a text file and replacing the relevant parts by regex based
>on the current URL (filename) in a series of if-blocks and returning the
>modified output, which is nearly like typing each html page out separately:
>
>--------- menu.pl -------
>So the example perl code is for only six pages, just imagine what it will
>look like with 50 or more pages and what kind of hassle that can be to
>maintain.
>Any ideas how to improve the code are of course more than welcome
-sln
--------------
use strict;
use warnings;
##
my $template1 = <<ETMP;
[
('1.1.html',Level 1.1
[
('2.1.html',Level 2.1)
('2.2.html',Level 2.2
[
('3.1.html',Level 3.1)
('3.2.html',Level 3.2)
]
)
('2.3.html',Level 2.3)
]
)
]
ETMP
my $pf = 0;
use re 'eval';
##
print qq{
<style type="text/css">
.node {
font-style: italic;
}
</style>
};
for my $target ('1.1.html',
'2.1.html',
'2.2.html',
'3.1.html',
'3.2.html',
'2.3.html',
'none' )
{
my $html = $template1;
1 while ($html =~ s/
(?:
'\s*$target\s*'\s*, ([^<\n]*) #1
| (parent)?'\s* ([^']*)\s*'\s*, ([^<\n]*) #2,3,4
| ( #5
\(
( #6
(?:
(?> [^()]+ )
| (?=\( '\s*$target\s*' ) (?{ $pf=1 }) (?5)
| (?5)
)*
)
\)
)
|
( #7
\[
( #8
(?:
(?> [^\[\]]+ )
| (?7)
)*
)
\]
)
)
/
my $tmp =
defined $5 ? "<li>". ($pf ? "parent" : "") ."$6<\/li>" :
defined $7 ? "<ul>$8<\/ul>" :
defined $3 ? "<a href=\"$3\"" .
(defined $2 ? " class=\"node\"" : "") .
">$4<\/a>" :
"$1";
$pf = 0;
$tmp
/xeg);
print "\n<!-- $target -->\n\n$html\n";
}
__END__
Output:
<style type="text/css">
.node {
font-style: italic;
}
</style>
<!-- 1.1.html -->
<ul>
<li>Level 1.1
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li><a href="2.2.html">Level 2.2</a>
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
<!-- 2.1.html -->
<ul>
<li><a href="1.1.html" class="node">Level 1.1</a>
<ul>
<li>Level 2.1</li>
<li><a href="2.2.html">Level 2.2</a>
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
<!-- 2.2.html -->
<ul>
<li><a href="1.1.html" class="node">Level 1.1</a>
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li>Level 2.2
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
<!-- 3.1.html -->
<ul>
<li><a href="1.1.html" class="node">Level 1.1</a>
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li><a href="2.2.html" class="node">Level 2.2</a>
<ul>
<li>Level 3.1</li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
<!-- 3.2.html -->
<ul>
<li><a href="1.1.html" class="node">Level 1.1</a>
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li><a href="2.2.html" class="node">Level 2.2</a>
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li>Level 3.2</li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
<!-- 2.3.html -->
<ul>
<li><a href="1.1.html" class="node">Level 1.1</a>
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li><a href="2.2.html">Level 2.2</a>
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li>Level 2.3</li>
</ul>
</li>
</ul>
<!-- none -->
<ul>
<li><a href="1.1.html">Level 1.1</a>
<ul>
<li><a href="2.1.html">Level 2.1</a></li>
<li><a href="2.2.html">Level 2.2</a>
<ul>
<li><a href="3.1.html">Level 3.1</a></li>
<li><a href="3.2.html">Level 3.2</a></li>
</ul>
</li>
<li><a href="2.3.html">Level 2.3</a></li>
</ul>
</li>
</ul>
------------------------------
Date: Sun, 12 Sep 2010 14:02:20 -0700 (PDT)
From: "..." <sustainable.future116@gmail.com>
Subject: Why Insulation is a Good Investment
Message-Id: <993d6fee-fb23-46a0-85b9-04af5b2695f9@h25g2000vba.googlegroups.com>
Investing in products to make homes more energy efficient pays
significant dividends over a lifetime - with none of the wild
fluctuations of Wall Street. Insulation contributes to:
- Greater comfort
- Even temperature distribution
- Improved acoustics
- Better moisture control, which can reduce floor squeaks, drywall
cracks, structure damage and condensation
- Potential for increased resale value: Installing proper insulation
levels can also make your home more attractive to potential buyers.
In fact, most buyers list energy-efficiency as a prime consideration.
The reason? Buyers know they can buy a more expensive home if heating
and cooling bills can be kept down.
- A more environmentally friendly home
- Lower energy bills* Unless your home was constructed with special
attention to energy efficiency, adding insulation will probably reduce
your utility bills.
- 60% of the existing homes in the United States are not insulated to
the best level.
- According toa study done by Harvard University's School of Public
Health, 60% of the exising homes are likely to use more energy than
newer homes, leading to very high heating and air-conditioning bills.
- Even if you own a new home, adding insulation may save enough money
in reduced utility bills to pay for itself within a few years and will
continue to save you money for as long as you own the home.*
Source: http://www.simplyinsulate.com/content/why/benefits.html
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3130
***************************************