[30869] in Perl-Users-Digest
Perl-Users Digest, Issue: 2114 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 11 03:14:22 2009
Date: Sun, 11 Jan 2009 00:14:14 -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 Sun, 11 Jan 2009 Volume: 11 Number: 2114
Today's topics:
Re: mail address validation <g_m@remove-comcast.net>
new CPAN modules on Sun Jan 11 2009 (Randal Schwartz)
Re: opening a file <jurgenex@hotmail.com>
Re: opening a file <jurgenex@hotmail.com>
Re: opening a file <jurgenex@hotmail.com>
Re: opening a file <wahab-mail@gmx.de>
Re: please help me to understand this code? <cartercc@gmail.com>
Re: please help me to understand this code? <pilcrow6@gmail.com>
Re: please help me to understand this code? <tim@burlyhost.com>
Re: Syntactic sugar for scope closing hook? <user42@zip.downwithspam.com.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 10 Jan 2009 20:17:33 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: mail address validation
Message-Id: <Y9adnTBKAu3E1fTUnZ2dnUVZ_rfinZ2d@giganews.com>
Petr Vileta "fidokomik"" >...
>
> I need this mail validation for webform only, not for my MTA. I do validation with
>
> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.!#$%&"*+-/=?^_`{|}~
>
> in left part and
>
> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-
>
> in domain part. In addition to this I check if mail address end with DOT + minimally 2 characters, so
> user@example.c - invalid
> user@example.cz - valid
>
> I do this validation because many users make typing errors, webform try to send message for these nonsensical addressess
> (every 4 hours again for 4 days) and my MTA gasp :-)
> --
~~~~~~~~~~~~~~~~~~~~~~
That seems reasonable. I don't think it will reject any valid addresses.
But if too many invalid ones keep getting through in spite,
then you may want to try again later, harder, (or else escape
to an unspoiled polynesian island).
It turns out that there's an RFC,
RFC 3696
http://www.isi.edu/in-notes/rfc3696.txt
that deals directly with your issue.
(---I was led to it from "Dan's Mail Format Site"
http://mailformat.dan.info/headers/from.html
--which, at the moment, I'm finding to be the clearest yet about these things.)
quote from the RFC 3696 : ...
1. Introduction
Designers of user interfaces to Internet applications have often found it useful
to examine user-provided values for validity before passing them to the Internet
tools themselves. This type of test, most commonly involving syntax checks
or application of other rules to domain names, email addresses, or "web addresses"
(URLs or, occasionally, extended URI forms (see Section 4)) may enable
better quality diagnostics for the user than might be available from the protocol
itself. Local validity tests on values are also thought to improve the efficiency
of back-office processing programs and to reduce the load on the protocols
themselves. Certainly, they are consistent with the well-established principle
that it is better to detect errors as early as possible.
The tests must, however, be made correctly or at least safely.
If criteria are applied that do not match the protocols, users will be
inconvenienced, addresses and sites will effectively become
inaccessible to some groups, and business and communications
opportunities will be lost. Experience in recent years indicates
that syntax tests are often performed incorrectly and that tests for
top-level domain names are applied using obsolete lists and
conventions. We assume that most of these incorrect tests are the
result of the inability to conveniently locate exact definitions for
the criteria to be applied. This document draws summaries of the
applicable rules together in one place and supplies references to the
actual standards. It does not add anything to those standards;
it merely draws the information together into a form that may be more
accessible.
Many experts on Internet protocols believe that tests and rules of
these sorts should be avoided in applications and that the tests in
the protocols and back-office systems should be relied on instead.
Certainly implementations of the protocols cannot assume that the
data passed to them will be valid. Unless the standards specify
particular behavior, this document takes no position on whether or
not the testing is desirable. It only identifies the correct tests
to be made if tests are to be applied.
The sections that follow discuss domain names, email addresses, and
URLs.
2. Restrictions on domain (DNS) names
...etc
------------------------------
Date: Sun, 11 Jan 2009 05:42:23 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jan 11 2009
Message-Id: <KDAL6n.19EI@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-Study-Perl-0.0.2
http://search.cpan.org/~andk/Acme-Study-Perl-0.0.2/
empirical studies about how perl behaves
----
Apache2-Controller-1.000.011
http://search.cpan.org/~markle/Apache2-Controller-1.000.011/
framework for Apache2 handler apps
----
Audio-Ecasound-Multitrack-0.981
http://search.cpan.org/~ganglion/Audio-Ecasound-Multitrack-0.981/
Perl extensions for multitrack audio processing
----
Audio-Ecasound-Multitrack-0.982
http://search.cpan.org/~ganglion/Audio-Ecasound-Multitrack-0.982/
Perl extensions for multitrack audio processing
----
BDB-1.83
http://search.cpan.org/~mlehmann/BDB-1.83/
Asynchronous Berkeley DB access
----
Catalyst-View-Seamstress-2.1_03
http://search.cpan.org/~draxil/Catalyst-View-Seamstress-2.1_03/
HTML::Seamstress View Class for Catalyst
----
DBIx-Web-0.78
http://search.cpan.org/~makarow/DBIx-Web-0.78/
Active Web Database Layer
----
DateTimeX-Easy-0.085
http://search.cpan.org/~rkrimen/DateTimeX-Easy-0.085/
Parse a date/time string using the best method available
----
Fuse-Class-0.01
http://search.cpan.org/~toshifjw/Fuse-Class-0.01/
Base clsas for Fuse module implementation using class.
----
Fuse-Filesys-Virtual-0.02
http://search.cpan.org/~toshifjw/Fuse-Filesys-Virtual-0.02/
mount Perl module written using Filesys::Virtual
----
GBrowse-1.985
http://search.cpan.org/~lds/GBrowse-1.985/
----
Google-Chart-0.05012
http://search.cpan.org/~dmaki/Google-Chart-0.05012/
Interface to Google Charts API
----
MouseX-Log-Dispatch-Config-0.02
http://search.cpan.org/~masaki/MouseX-Log-Dispatch-Config-0.02/
----
Net-Twitter-2.00_03
http://search.cpan.org/~cthom/Net-Twitter-2.00_03/
Perl interface to twitter.com
----
Palm-SMS-0.03
http://search.cpan.org/~dcantrell/Palm-SMS-0.03/
parse SMS database files
----
Parse-Marpa-1.001_000
http://search.cpan.org/~jkegl/Parse-Marpa-1.001_000/
Generate Parsers from any BNF grammar
----
String-CaseProfile-0.14
http://search.cpan.org/~enell/String-CaseProfile-0.14/
Get/Set the letter case profile of a string
----
Term-Interact-0.50
http://search.cpan.org/~prl/Term-Interact-0.50/
Interactively Get Validated Data
----
Text-Sprintf-Named-0.0202
http://search.cpan.org/~shlomif/Text-Sprintf-Named-0.0202/
sprintf-like function with named conversions
----
Text-Sprintf-Named-0.0203
http://search.cpan.org/~shlomif/Text-Sprintf-Named-0.0203/
sprintf-like function with named conversions
----
WWW-Ebay-0.087
http://search.cpan.org/~mthurn/WWW-Ebay-0.087/
Search and manage eBay auctions
----
WWW-Search-Ebay-3.004
http://search.cpan.org/~mthurn/WWW-Search-Ebay-3.004/
backend for searching www.ebay.com
----
X11-GUITest-record-0.14
http://search.cpan.org/~mkoderer/X11-GUITest-record-0.14/
Perl implementation of the X11 record extension.
----
XSLT-Cache-0.1
http://search.cpan.org/~andy/XSLT-Cache-0.1/
Transparent preparsing and caching XSLT documents
----
minismokebox-0.01_01
http://search.cpan.org/~bingos/minismokebox-0.01_01/
a small lightweight SmokeBox
----
minismokebox-0.01_02
http://search.cpan.org/~bingos/minismokebox-0.01_02/
a small lightweight SmokeBox
----
xcruciate-001
http://search.cpan.org/~melonman/xcruciate-001/
----
xcruciate-002
http://search.cpan.org/~melonman/xcruciate-002/
----
xcruciate-unitconfig-001
http://search.cpan.org/~melonman/xcruciate-unitconfig-001/
----
xcruciate-utils-001
http://search.cpan.org/~melonman/xcruciate-utils-001/
----
xcruciate-xcruciateconfig-001
http://search.cpan.org/~melonman/xcruciate-xcruciateconfig-001/
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
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: Sat, 10 Jan 2009 07:24:45 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: opening a file
Message-Id: <eafhm4duhdnaampqpb3fbna31p9qqufgpc@4ax.com>
Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
>In the future if someone refers you to perldoc -q, it's a reference to
>the FAQ, which is here:
>
>http://perldoc.perl.org/perlfaq.html
Except that that may not be identical to the version installed on his
computer and applicable to his version of Perl.
The web site is ok, but it is better to install Perl properly including
perldoc and have the matching manuals available locally.
jue
------------------------------
Date: Sat, 10 Jan 2009 07:27:01 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: opening a file
Message-Id: <qefhm4t7pdi1tokggj48enf5bkloniqpmm@4ax.com>
"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>On 2009-01-10 03:11, George <george@example.invalid> wrote:
>> On Fri, 09 Jan 2009 18:24:38 -0800, Jürgen Exner wrote:
>>> George <george@example.invalid> wrote:
>>>>Shoot, I get nothing for output here. I added asymbol to yours, but I
>>>>still get nothing. I have to believe that USER ERROR is rearing its head
>>>>and laughing at me.
>>>>
>>>> open(50, '<ehp3.txt>');
>>>> DO:
>>>> { my $line = readline(*50);
>>>> if(eof != 0) { exit }
>>>> print $line; # no 'write' here
>>>> redo DO } # no 'end' possible
>>>> close(50)
>>>
>>> Ouch! This hurts!
>
>I'm sure Mirco meant that as a joke.
Unfortunately is seems like George didn't get that joke :-(
jue
------------------------------
Date: Sat, 10 Jan 2009 07:31:50 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: opening a file
Message-Id: <ujfhm4p80lmuu1k6tpumq5jq3orcki6ttj@4ax.com>
George <george@example.invalid> wrote:
>On Thu, 08 Jan 2009 10:52:23 -0800, Jürgen Exner wrote:
>> cartercc <cartercc@gmail.com> wrote:
>>>open INFILE, "<nameoffile.txt";
>>
>> Most people would suggest to use the three-argument form of open:
>> open INFILE, '<', 'nameoffile.txt';
>>
>> Almost all people would strongly suggest to test for failure:
>> open INFILE, '<', 'nameoffile.txt' or
>> die "Cannot open nameoffile.txt because $!\n";
>
>Apparently, going out and getting drunk was exactly what this script
>needed, as well as comments that helped.
Do you actually read what people are writing before replying to a
posting?
> open(50, '<eph4.txt');
Obviously not.
Again two argument form, again no test for failure (although it would
have cought the misspelled file name as evidenced in a different post).
> DO:
> { my $line = readline(*50);
> if(eof != 0) { exit }
> print $line; # no 'write' here
> redo DO } # no 'end' possible
> close(50)
Again Fortran code disguised as Perl.
Ok, I had it. Bye bye, farewell, won't see you again.
jue
------------------------------
Date: Sat, 10 Jan 2009 21:00:34 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: opening a file
Message-Id: <gkauu4$p79$1@mlucom4.urz.uni-halle.de>
George wrote:
> Apparently, going out and getting drunk was exactly what this script
> needed, as well as comments that helped.
>
> open(50, '<eph4.txt');
> DO:
> { my $line = readline(*50);
> if(eof != 0) { exit }
> print $line; # no 'write' here
> redo DO } # no 'end' possible
> close(50)
geaorge, *PLEASE* don't think this
above snippet would be anything useable
in Perl. It's a joke, nothing more.
The best thing would be to replace
this (faulk4.pl) completely by something
like the following code:
use strict;
use warnings;
my $filename = 'eph4.txt';
open my $filehandle, '<', $filename or die "$filename $!";
while( my $line = <$filehandle> ) {
print $line;
}
close $filehandle;
The same thing has bee suggested by
others too, several times. From *here*,
you'll be able to advance further -
but better not from the 'fortran-style'
thing I suggested last week for fun.
Regards
M.
------------------------------
Date: Sat, 10 Jan 2009 11:13:30 -0800 (PST)
From: cartercc <cartercc@gmail.com>
Subject: Re: please help me to understand this code?
Message-Id: <ae5e6967-0f8f-42a9-95ce-6411262d9bd9@17g2000vbf.googlegroups.com>
All this is OT, and I had decided to reply, waiting for two days, but
now I will reply. Please note that this is NOT to be interpreted as
personally insulting, as I have no wish to insult you.
On Jan 9, 4:44=A0pm, Pilcrow <pilcr...@gmail.com> wrote:
> On Fri, 9 Jan 2009 12:48:28 -0800 (PST), cartercc <carte...@gmail.com>
> wrote:
>
> >On Jan 9, 1:21=A0pm, Pilcrow <pilcr...@gmail.com> wrote:
> >> Sorry to have disturbed Your Majesty
This is what you wrote, a sarcastic and offensive reply to someone who
I cannot recall ever being sarcastic or offensive himself. You said
'Your Majesty' when you really meant, 'Peon: Who are you to decline to
give Me, My Majesty, exactly what I want.'
In point of fact, Gleixner gave you some very good advice, which is a
lot more useful to you that would have been a line by line exposition
of the algorithm. I, too, had a similar issue with a very neat little
trick called a Schwartzian Transform. I stared at it for (literally)
years trying to understand it before I ran it (with the debugger) and
examined the state of the runtime stack value by value. The BAST way
to understand an algorithm is to step through it, examining the state
of each data item as you go.
If you don't know how to do this, or don't think it's a legitimate
approach to understanding a piece of code, well, you've just
embarrassed yourself a second time in c.l.p.m.
>
> >I suppose
> >that G got what he deserved by casting his pearls before swine, or a
> >swine, which is exactly what you seem by your response.
>
> I don't remember using language remotely as offensive as yours, but
> perhaps you have not got the mental facility to insult a person without
> yourself crawling into the gutter. =A0
Okay, I was making a literary reference. The book is very well known -
you may have heard of it - it's called the Bible. My reference was to
a conversation one of the major characters, Jesus, had with some
friends. It's actually a two part quote, but I omitted the second part
in order to emphasize it, thinking that you would complete the quote
in your mind. Since you appear not to be familiar with this, or too
dimwitted to recognize it, I'll do this for you.
The second part goes like this: "... lest they trample them underfoot
and then turn and devour you." My point was that G. had attempted to
bestow a precious gift to you which you not only threw back in his
face but added personal insult. Please think about these words before
you reply.
> I was sarcastic.. =A0I was not insulting. =A0I am capable, in several
> languages, of saying extremely insulting, vile, things. =A0But then, I
> would become your comrade in filth, and I prefer not to.
I didn't say that you WERE a swine, simply that your words SEEMED to
make you so. There is a difference. You are not your words, and if by
some chance you use words (out of thoughtlessness or irritation,
maybe) that you don't mean, you can always take them back. I guess
that in this case you meant the remark about 'Your Majesty' so I'll
have nothing further to say on the subject.
CC
------------------------------
Date: Sat, 10 Jan 2009 21:56:44 -0800
From: Pilcrow <pilcrow6@gmail.com>
Subject: Re: please help me to understand this code?
Message-Id: <8f2jm41j4v6ishbffiaqadu990etae9ljq@4ax.com>
On Sat, 10 Jan 2009 11:13:30 -0800 (PST), cartercc <cartercc@gmail.com>
wrote:
>All this is OT, and I had decided to reply, waiting for two days, but
>now I will reply. Please note that this is NOT to be interpreted as
>personally insulting, as I have no wish to insult you.
>
>On Jan 9, 4:44 pm, Pilcrow <pilcr...@gmail.com> wrote:
>> On Fri, 9 Jan 2009 12:48:28 -0800 (PST), cartercc <carte...@gmail.com>
>> wrote:
>>
>> >On Jan 9, 1:21 pm, Pilcrow <pilcr...@gmail.com> wrote:
>> >> Sorry to have disturbed Your Majesty
>
>This is what you wrote, a sarcastic and offensive reply to someone who
>I cannot recall ever being sarcastic or offensive himself. You said
>'Your Majesty' when you really meant, 'Peon: Who are you to decline to
>give Me, My Majesty, exactly what I want.'
>
>In point of fact, Gleixner gave you some very good advice, which is a
>lot more useful to you that would have been a line by line exposition
>of the algorithm. I, too, had a similar issue with a very neat little
>trick called a Schwartzian Transform. I stared at it for (literally)
>years trying to understand it before I ran it (with the debugger) and
>examined the state of the runtime stack value by value. The BAST way
>to understand an algorithm is to step through it, examining the state
>of each data item as you go.
>
>If you don't know how to do this, or don't think it's a legitimate
>approach to understanding a piece of code, well, you've just
>embarrassed yourself a second time in c.l.p.m.
>
>>
>> >I suppose
>> >that G got what he deserved by casting his pearls before swine, or a
>> >swine, which is exactly what you seem by your response.
>>
>> I don't remember using language remotely as offensive as yours, but
>> perhaps you have not got the mental facility to insult a person without
>> yourself crawling into the gutter.
>
>Okay, I was making a literary reference. The book is very well known -
>you may have heard of it - it's called the Bible. My reference was to
>a conversation one of the major characters, Jesus, had with some
>friends. It's actually a two part quote, but I omitted the second part
>in order to emphasize it, thinking that you would complete the quote
>in your mind. Since you appear not to be familiar with this, or too
>dimwitted to recognize it, I'll do this for you.
>
>The second part goes like this: "... lest they trample them underfoot
>and then turn and devour you." My point was that G. had attempted to
>bestow a precious gift to you which you not only threw back in his
>face but added personal insult. Please think about these words before
>you reply.
>
>> I was sarcastic.. I was not insulting. I am capable, in several
>> languages, of saying extremely insulting, vile, things. But then, I
>> would become your comrade in filth, and I prefer not to.
>
>I didn't say that you WERE a swine, simply that your words SEEMED to
>make you so. There is a difference. You are not your words, and if by
>some chance you use words (out of thoughtlessness or irritation,
>maybe) that you don't mean, you can always take them back. I guess
>that in this case you meant the remark about 'Your Majesty' so I'll
>have nothing further to say on the subject.
>
>CC
>
I was hoping not to have to do this, but (sigh)..
Last month I happened to see an article asking for help with homework.
"Camel" <jiao_he@sbcglobal.net> in article
<VK_Zk.7526$as4.4004@nlpi069.nbdc.sbc.com> asked how to print all the
permutations of a string of digits of arbitrary length. Several
people replied, but seemed more interested in preening themselves in
their superiority to "Camel" than in actually helping him.
Not knowing how to do it myself, I started playing around. It is
relatively easy to write a program to print all the permutations of a
list, or array (yes I know the difference) if you already know the
length of the input list. But to permute a list whose length is not
known in advance is more difficult.
Eventually I came across perlfaq 4.51 (perldoc -q permute), and the
code that I quoted in my original message.
I tried to understand both the algorithm (Fischer-Krause Algorithm)
and most of the perl idiom implementing it. The code worked as
advertized, but how?
My enquiry started by a search of Wikipedia. No luck. Then I tried a
google search. Almost all the documents returned were various
mirrors, throughout the world, of perlfaq4 or perlfaq 4.51. Several
documents were in Japanese, several in German. I read neither. Some
documents mention it in passing. From one of those I learned that the
algorithm dated from 1819! One result,from ACM, wanted me to pay $198
before downloading a PDF document (without being sure of its
relevance).
In the meantime I was playing with the code from faq 4.51, with very
small results.
Then I posted my query. I didn't want to recite the details of my
lengthy investigation, so I simply asked my questions.
The first two responses assumed I had done nothing to help myself. Mr
Gleichner told me about Data::Dumper and print, both familiar to me
for a number of years. Then he told me to search the internet.
Mr Greer said:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It says what it does, so I assume you mean the actual code? If so,
what parts are you not understanding? What parts _do_ you understand?
Knowing this will be helpful to giving you the best answer, without
anyone having to go into great detail or explain every aspect (since
if you didn't know any of it, it probably wouldn't do you any good to
have someone explain it when it comes down to it). That is, you must
have looked for or saw this code somewhere and wanted to use it, so
you must have some idea of what it does?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did he not see that I had told him the source of the code? And then he
excused himself from helping, since it wouldn't do any good!
So I made a couple of quick remarks to both of those snobs. Am I
depriving myself of their help? What help? I called one "Your
Majesty", the other "Your Holiness". Insulting? Only if you think
comparison to majesty and holiness is insulting.
Now to you: I knew the provenience of 'pearls before swine', and I
probably came into contact with the Bible several decades before you
did. (You don't know how ancient I am.) Perhaps you don't realize that
Jesus was Jewish, and the Jews have a profound revulsion to anything
having to do with swine. To call someone 'swine' was an insult then
and it is an insult now. But I forgive you, for you know not what you
do.
I also came into contact with the "Schwartzian Transform" a number of
years ago, but I didn't need the debugger to understand it.
Incidentally, Wikipedia has an excellent article on it, in which it is
explained that the idea is not original with Randal L. Schwartz, nor
with perl.
Now that I have a better understanding of the Fischer-Krause
Algorithm, thanks largely to xhoster, perhaps I will write an article
about it on Wikipedia, unless, of course, one of you folks, in your
infinite superiority to me, beats me to it. The race is on!
__
Evybuddy needs sumbuddy that they kin look down on.
Eff yo aint got no wun else, why, hep yoseff to me.
------------------------------
Date: Sat, 10 Jan 2009 22:18:11 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: please help me to understand this code?
Message-Id: <Eagal.14567$3_4.12438@newsfe10.iad>
Pilcrow wrote:
> Mr Greer said:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> It says what it does, so I assume you mean the actual code?  If so,
> what parts are you not understanding?  What parts _do_ you understand?
> Knowing this will be helpful to giving you the best answer, without
> anyone having to go into great detail or explain every aspect (since
> if you didn't know any of it, it probably wouldn't do you any good to
> have someone explain it when it comes down to it).  That is, you must
> have looked for or saw this code somewhere and wanted to use it, so
> you must have some idea of what it does?
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Did he not see that I had told him the source of the code? And then he
> excused himself from helping, since it wouldn't do any good!
>
> So I made a couple of quick remarks to both of those snobs.  Am I
> depriving myself of their help?  What help?  I called one "Your
> Majesty",  the other "Your Holiness".  Insulting?  Only if you think
> comparison to majesty and holiness is insulting.
You posted random code, as far as everyone here could know, which you
might have just found and not have known if it's even relevant (believe
it or not, that happens). You could have quickly mentioned your issue
and goal, and that you know what "this part does" and maybe asked about
some specific function.
It's not "snobby" to ask someone literally what they already understand.
You might not have known what the shebang line was and -n, you might
not have known what "sub" meant, or (&@), or "my", "shift", etc. You
might not have known the difference between = and ==. You might not
have known what $var and @var were, or that lines starting with # are
comments. You might not have known what "while" is, or what --$q or
++$q do (or for that matter, the differences between --$q and $q--, or
what $idx[$p-1] is, or what return does. You might not have known what
push does, or reverse, or splice, or split, or how curly braces work,
and on and on. Just exactly where does the answer start or end? Should
I have made a reckless attempt to answer you anyway, and risked
confusion or not actually helping you (after wasting who knows how much
time with the reply, depending on the detail of the answer)? Granted,
if someone believes they understood and have some theory about what
should be an appropriate answer, that's great, but if someone doesn't
have anything to go on, you run that risk (and probably risk being
insulted in response anyway, if someone's that unreasonable).
I didn't excuse myself from helping, I was asking a genuine question. I
actually started to reply, but then thought "what good would it do to
break it down, if it'll only lead to more questions or cause the OP
(you) confusion?" It might not have helped. Surely, you knew what
_some_ of the code did, so what parts were you asking about? That
allows people to follow up with more relevant and more
detailed/in-depth responses that contain the answers you are looking
for. I had no way to determine what level of understanding you were
at, so I didn't know how to reply and chance misleading you. Not
giving people here the benefit of the doubt, whom are genuinely here
interested in offering help to posters, you start making snide and rude
remarks, which is really immature.
You think people post help here just to try and act superior? I urged
you to clarify the information you were asking about, so I could offer
help. Apparently that's not rational regardless of what was said or
the intent, you'd rather pass insults? You can plainly see that my
asking you was not whatsoever intended to make you feel like less of a
person, but to understand the question so I could help. There's no
reason to be terse and rude. I am fully aware that there are arrogant
people on any news group out there, and you pretty much can't go
anywhere online and ask a simple question in a friendly and civil
manner, without some person with "issues" that will want to attack you
or try and act like a know it all, but don't let that fact make you
believe that everyone is like that, or to jump the gun and assume that
about people without some grounds to actually form that opinion.
Seriously, blaming your rudeness and inability to act civil on what
other people do, isn't going to win you any sympathy. If my reply in
an attempt to gather the information needed to properly assist you came
off as rude or snobbish, than I apologize, because that was absolutely
not the intent.
--
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: Sun, 11 Jan 2009 10:48:27 +1100
From: Kevin Ryde <user42@zip.downwithspam.com.au>
Subject: Re: Syntactic sugar for scope closing hook?
Message-Id: <877i52yb78.fsf@blah.blah>
Steve Roscio <steve.roscio@hp.com> writes:
>
> syntactically look nicer
There's quite a few of those finalizer things. Hook::Scope or
B::Hooks::EndOfScope might do enough syntax for you. Scope::Upper might
help create such a thing. The basic ones include AtExit, Guard and
Sub::ScopeFinalizer, but personally I've found the little Scope::Guard
already mentioned enough.
------------------------------
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 2114
***************************************