[31962] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3226 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 3 03:09:35 2010

Date: Fri, 3 Dec 2010 00:09:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 3 Dec 2010     Volume: 11 Number: 3226

Today's topics:
    Re: Optimisation for tight loops... <schaitan@gmail.com>
    Re: Optimisation for tight loops... <uri@StemSystems.com>
    Re: Optimisation for tight loops... <hjp-usenet2@hjp.at>
    Re: Optimisation for tight loops... <kst-u@mib.org>
    Re: Optimisation for tight loops... <uri@StemSystems.com>
    Re: Optimisation for tight loops... <marc.girod@gmail.com>
    Re: Optimisation for tight loops... <hjp-usenet2@hjp.at>
    Re: Optimisation for tight loops... <kst-u@mib.org>
    Re: Optimisation for tight loops... <uri@StemSystems.com>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@seesig.invalid
        work to heal <r@thevoid1.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 2 Dec 2010 11:14:20 -0800 (PST)
From: Krishna Chaitanya <schaitan@gmail.com>
Subject: Re: Optimisation for tight loops...
Message-Id: <b24c76f1-a645-4b7f-b91a-a70202edfb49@v17g2000prc.googlegroups.com>

Hi all, thanks for the criticism of my poor choice of operators as
well as test cases. I appreciate your time and wisdom.

One last question - in the ocean of Perl literature and documentation,
is there any one single place where points similar to what you've
raised in your replies are mentioned (rather explicitly)? Like, for
example, the choice of operators and the consequences in terms of
speed, etc? My situation is: I don't have a lot of time to go through
a large body of knowledge as other concerns are pressing...and can
hardly afford a Perl expert's time. I know this might invite a lot of
flak from those who love to do things the right way...but, if you can
help me, I'd be grateful.


------------------------------

Date: Thu, 02 Dec 2010 14:36:45 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Optimisation for tight loops...
Message-Id: <87tyiw0xwy.fsf@quad.sysarch.com>

>>>>> "KC" == Krishna Chaitanya <schaitan@gmail.com> writes:

  KC> One last question - in the ocean of Perl literature and
  KC> documentation, is there any one single place where points similar
  KC> to what you've raised in your replies are mentioned (rather
  KC> explicitly)? Like, for example, the choice of operators and the
  KC> consequences in terms of speed, etc? My situation is: I don't have
  KC> a lot of time to go through a large body of knowledge as other
  KC> concerns are pressing...and can hardly afford a Perl expert's
  KC> time. I know this might invite a lot of flak from those who love
  KC> to do things the right way...but, if you can help me, I'd be
  KC> grateful.

there is a reason it is called expertise and that there are
experts. experts are the ones who write the docs that you don't have the
time to read. there are no shortcuts to becoming an expert. google for
'10000 hour expert'

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: Thu, 2 Dec 2010 21:51:07 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Optimisation for tight loops...
Message-Id: <slrnifg1lr.669.hjp-usenet2@hrunkner.hjp.at>

On 2010-12-02 18:35, Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "KC" == Krishna Chaitanya <schaitan@gmail.com> writes:
>
>  KC> " If you are searching for an element in a list, it can be more
>  KC> efficient to store the data in a hash structure, and then simply look
>  KC> to see whether the key is defined, rather than to loop through the
>  KC> entire array using grep() for instance. " (from perlperf)
>
> anyone here could have told you that.

Why should he ask here if it's already in the docs? Aren't we constantly
telling people to read the docs? Now somebody does and you're chewing
him out for it.

	hp


------------------------------

Date: Thu, 02 Dec 2010 13:02:28 -0800
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Optimisation for tight loops...
Message-Id: <lnwrnropln.fsf@nuthaus.mib.org>

"Uri Guttman" <uri@StemSystems.com> writes:
>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
>
>   >> no dynamic lang (and i assume it is the others are who are badmouthing
>   >> perl) can do loop unrolling and such. this is because things can change
>   >> at runtime with tied things, symrefs, and eval string. no compiler can
>   >> handle such things and optimize them out of a loop or unroll a loop.
>
>   KT> Why not?  Perl is compiled before it's executed, after all, and
>   KT> the compiler *could* determine that the body of a loop doesn't do
>   KT> anything disruptive and use that information to perform optimizations
>   KT> (loop unrolling, common subexpression elimination, etc.).
>
>   KT> It's not at all clear that it makes sense to do so, given that
>   KT> you're going to pay the overhead each time the program is executed.
>   KT> And I have no idea what optimizations the perl implementation
>   KT> actually performs.  But I suggest that your "no dynamic lang"
>   KT> claim is overstated.
>
> then why haven't you ever seen any dynamic lang do any of the classic
> loop optimizations you see in classic compiled langs like fortran?

For one thing, because I haven't looked.  Aside from that, I don't
know for sure, but it's likely because such optimizations are too
difficult, are too seldom applicable, and have too little payoff,
for them to be worth the effort.

>                                                                    you
> can't. loop unrolling and constant subexpression expression moving can't
> be done if the values can change underneath as they can in a language
> like perl. a sub call which can be chosen at runtime in the loop can
> change the WHOLE loop by calling eval. and that can't be detected. any
> variable in the loop could be tied which is a runtime thing and that
> could call anything which could change the loop. no compiler can see or
> predict those sorts of things. perl does constant folding, conversions
> of constant style subs (as what the constant pragma does) to real
> constants and not much else. those things can't have variables or
> anything other than pure constants at compile time.

Consider this complete program:

#!/usr/bin/perl

use strict;
use warnings;

my $i = 0;
for (1 .. 10) {
    $i ++;
}
print "$i\n";

The Perl compiler/interpreter can see the entire program before it
produces any output.  At least in principle, it *could* analyze it
and determine that $i isn't tied, that there are no sub calls in the
loop, that there are no calls to eval(), and so forth.  Given that
information, it *could* compile the whole thing to the equivalent of

    print "10\n";

In this particular case, the time spent doing the analysis and code
transformation would certainly exceed the time saved by simplifying the
code.  And in general, I'm not arguing that perl *should* do this kind
of thing, just that it's not impossible.

Even in a static compiled language like C, certain constructs can
inhibit certain optimizations.  A optimizing C compiler could likely
reduce something like the above to puts("10"), but would not be able to
do so if the loop body took the address of i or called an external
function.  Perl, as you point out, has more constructs that can
interfere with this kind of analysis.  That doesn't make the analysis
impossible in every case.

-- 
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: Thu, 02 Dec 2010 16:15:47 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Optimisation for tight loops...
Message-Id: <87mxon27wc.fsf@quad.sysarch.com>

>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:

  KT> "Uri Guttman" <uri@StemSystems.com> writes:

  >> >> no dynamic lang (and i assume it is the others are who are badmouthing
  >> >> perl) can do loop unrolling and such. this is because things can change
  >> >> at runtime with tied things, symrefs, and eval string. no compiler can
  >> >> handle such things and optimize them out of a loop or unroll a loop.

  >> then why haven't you ever seen any dynamic lang do any of the classic
  >> loop optimizations you see in classic compiled langs like fortran?

  KT> For one thing, because I haven't looked.  Aside from that, I don't
  KT> know for sure, but it's likely because such optimizations are too
  KT> difficult, are too seldom applicable, and have too little payoff,
  KT> for them to be worth the effort.

loop optimizations are an ancient technique that probably got invented
in the 60's if not earlier. it is well known by all compiler people. it
isn't even that complicated to do. perl COULD do it if it made sense as
it just involves scanning the opcode tree for invariant sections in
loops and moving them before the loop. loop unrolling is also a common
thing. perl can't do them not because of the lack of skill but because
the language won't allow it. you can't compile and know what will happen
at runtime which can screw up the optimizations. so it isn't even
discussed let alone attempted. 

  KT> Consider this complete program:

  KT> #!/usr/bin/perl

  KT> use strict;
  KT> use warnings;

  KT> my $i = 0;
  KT> for (1 .. 10) {
  KT>     $i ++;
  KT> }
  KT> print "$i\n";

  KT> The Perl compiler/interpreter can see the entire program before it
  KT> produces any output.  At least in principle, it *could* analyze it
  KT> and determine that $i isn't tied, that there are no sub calls in the
  KT> loop, that there are no calls to eval(), and so forth.  Given that
  KT> information, it *could* compile the whole thing to the equivalent of

and what if warnings was replaced by a trojan module that made declaring
$i a tied variable?

  KT> Even in a static compiled language like C, certain constructs can
  KT> inhibit certain optimizations.  A optimizing C compiler could likely
  KT> reduce something like the above to puts("10"), but would not be able to
  KT> do so if the loop body took the address of i or called an external
  KT> function.  Perl, as you point out, has more constructs that can
  KT> interfere with this kind of analysis.  That doesn't make the analysis
  KT> impossible in every case.

it is impossible. that is the win and loss of a dynamic language. if you
could analyze it completely in advance, you could also solve the halting
problem. and even if it were possible, it isn't worth the effort as that
deep of an analysis is equivilent to running the program (see halting
problem).

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: Thu, 2 Dec 2010 13:31:04 -0800 (PST)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: Optimisation for tight loops...
Message-Id: <79bf922c-85ae-4e6d-aa83-e4eced982c67@p1g2000yqm.googlegroups.com>

On Dec 2, 9:15=A0pm, "Uri Guttman" <u...@StemSystems.com> wrote:

> and what if warnings was replaced by a trojan module that made declaring
> $i a tied variable?

Do you mean that perl doesn't compile warnings from the sources at
this stage?
Because if it does, it knows at compile time.

Marc


------------------------------

Date: Thu, 2 Dec 2010 22:40:26 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Optimisation for tight loops...
Message-Id: <slrnifg4ia.669.hjp-usenet2@hrunkner.hjp.at>

On 2010-12-02 18:43, Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
>
>  >> no dynamic lang (and i assume it is the others are who are
>  >> badmouthing perl) can do loop unrolling and such. this is because
>  >> things can change at runtime with tied things, symrefs, and eval
>  >> string. no compiler can handle such things and optimize them out
>  >> of a loop or unroll a loop.
>
>  KT> Why not?  Perl is compiled before it's executed, after all, and
>  KT> the compiler *could* determine that the body of a loop doesn't do
>  KT> anything disruptive and use that information to perform optimizations
>  KT> (loop unrolling, common subexpression elimination, etc.).
>
>  KT> It's not at all clear that it makes sense to do so, given that
>  KT> you're going to pay the overhead each time the program is executed.
>  KT> And I have no idea what optimizations the perl implementation
>  KT> actually performs.  But I suggest that your "no dynamic lang"
>  KT> claim is overstated.
>
> then why haven't you ever seen any dynamic lang do any of the classic
> loop optimizations you see in classic compiled langs like fortran?

Mostly because it's not worth it. Loop unrolling is a technique that
works well for real CPUs because jumps are expensive (or rather, they
were expensive - I'm not sure if loop unrolling is still worthwhile on
modern CPUs), but that doesn't apply to typical bytecode interpreters. 

Here's a simple example. A loop which fills an array with a constant
value:


#!/usr/bin/perl

use warnings;
use strict;

use Benchmark qw(:hireswallclock timethese cmpthese);

my @a;

my $results = timethese(-3, {
    normal => sub {
		for (0 .. 999_999) {
		    $a[$_] = 0;
		}
	    },
    unroll4 => sub {
		for (0 .. 249_999) {
		    $a[$_ * 4 + 0] = 0;
		    $a[$_ * 4 + 1] = 0;
		    $a[$_ * 4 + 2] = 0;
		    $a[$_ * 4 + 3] = 0;
		}
	    },
    unroll4c => sub {
		my $c = 0;
		for (0 .. 249_999) {
		    $a[$c++] = 0;
		    $a[$c++] = 0;
		    $a[$c++] = 0;
		    $a[$c++] = 0;
		}
	    },
    }
);

cmpthese($results);
__END__

           Rate  unroll4 unroll4c   normal
unroll4  4.04/s       --     -33%     -37%
unroll4c 6.00/s      49%       --      -6%
normal   6.37/s      58%       6%       --

The result is not surprising: The unrolled versions are slower.
The extra computations more than make up for the lower loop overhead.
In machine code, special addressing modes could be used in "unroll4"
instead of the explicit multiplication and addition, or the computations
could be performed in parallel to the memory accesses. Similarly in
"unroll4c". 


> you can't. loop unrolling and constant subexpression expression moving
> can't be done if the values can change underneath as they can in a
> language like perl.

Most of the time the values don't change underneath, and 
in many cases this could be detected by the compiler. But such analysis
is expensive. When the program is compiled on every run, this is hard to
amortize, even if there is a noticable speedup, which doesn't seem to be
the case for loop unrolling.

There are other techniques which are cheaper and gain more, for example JIT.

	hp



------------------------------

Date: Thu, 02 Dec 2010 17:59:02 -0800
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Optimisation for tight loops...
Message-Id: <lnpqtjobvd.fsf@nuthaus.mib.org>

"Uri Guttman" <uri@StemSystems.com> writes:
>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
[...]
>   KT> Consider this complete program:
>
>   KT> #!/usr/bin/perl
>
>   KT> use strict;
>   KT> use warnings;
>
>   KT> my $i = 0;
>   KT> for (1 .. 10) {
>   KT>     $i ++;
>   KT> }
>   KT> print "$i\n";
>
>   KT> The Perl compiler/interpreter can see the entire program before it
>   KT> produces any output.  At least in principle, it *could* analyze it
>   KT> and determine that $i isn't tied, that there are no sub calls in the
>   KT> loop, that there are no calls to eval(), and so forth.  Given that
>   KT> information, it *could* compile the whole thing to the equivalent of
>
> and what if warnings was replaced by a trojan module that made declaring
> $i a tied variable?

Then the hypothetical loop-optimizing Perl implementation would
analyze the contents of warnings.pm, fail to prove that it doesn't
do anything disruptive, and refrain from performing the optimization.

But if warnings *isn't* replaced by a Trojan module, the
implementation can, in principle, detect that fact.

Or, if you prefer, consider a program like the above but without
the "use strict; use warnings;" (and invoked without using perl's
-m or -M option or equivalent).

>   KT> Even in a static compiled language like C, certain constructs can
>   KT> inhibit certain optimizations.  A optimizing C compiler could likely
>   KT> reduce something like the above to puts("10"), but would not be able to
>   KT> do so if the loop body took the address of i or called an external
>   KT> function.  Perl, as you point out, has more constructs that can
>   KT> interfere with this kind of analysis.  That doesn't make the analysis
>   KT> impossible in every case.
>
> it is impossible. that is the win and loss of a dynamic language. if you
> could analyze it completely in advance, you could also solve the halting
> problem.

That doesn't follow.  The halting problem is about the impossibility
of doing certain kinds of analysis on *all* programs.  You are
claiming that certain kinds of analysis are impossible on *any*
programs, a much stronger claim.

The halting theorem doesn't imply that you can't prove the "hello,
world" program terminates.

>          and even if it were possible, it isn't worth the effort as that
> deep of an analysis is equivilent to running the program (see halting
> problem).

No, it isn't, at least not in all cases.  *I* can look at the above
program and conclude that it will print "10" followed by a new-line.
I don't have to run the program to reach that conclusion, and it
wouldn't take me 100 times as long if the 10 were changed to 1000.
There's no reason a compiler can't perform the same analysis *for
at least some programs*.

(Note that I'm not arguing that it *is* worth the effort, merely that
your argument that it isn't is incorrect.)

And who knows, *maybe* there are some loop optimizations that would
be worth doing in Perl, at least optionally.

-- 
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: Thu, 02 Dec 2010 21:09:32 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Optimisation for tight loops...
Message-Id: <87ei9z1uar.fsf@quad.sysarch.com>

>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:

  KT> "Uri Guttman" <uri@StemSystems.com> writes:
  >>>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:
  KT> [...]
  KT> Consider this complete program:
  >> 
  KT> #!/usr/bin/perl
  >> 
  KT> use strict;
  KT> use warnings;
  >> 
  KT> my $i = 0;
  KT> for (1 .. 10) {
  KT> $i ++;
  KT> }
  KT> print "$i\n";
  >> 
  KT> The Perl compiler/interpreter can see the entire program before it
  KT> produces any output.  At least in principle, it *could* analyze it
  KT> and determine that $i isn't tied, that there are no sub calls in the
  KT> loop, that there are no calls to eval(), and so forth.  Given that
  KT> information, it *could* compile the whole thing to the equivalent of
  >> 
  >> and what if warnings was replaced by a trojan module that made declaring
  >> $i a tied variable?

  KT> Then the hypothetical loop-optimizing Perl implementation would
  KT> analyze the contents of warnings.pm, fail to prove that it doesn't
  KT> do anything disruptive, and refrain from performing the optimization.

and if that module loads another module? ad infinitum. welcome to the
halting problem. do you even know what that is?

  KT> That doesn't follow.  The halting problem is about the impossibility
  KT> of doing certain kinds of analysis on *all* programs.  You are
  KT> claiming that certain kinds of analysis are impossible on *any*
  KT> programs, a much stronger claim.

no, it is the same problem. you have to keep analyzing deeper and
deeper. the issue isn't about small things being optimized, it is how
much work you need to do to gain a worthy optimization. you have already
exceeded that limit.

  KT> (Note that I'm not arguing that it *is* worth the effort, merely that
  KT> your argument that it isn't is incorrect.)

no, it is the same. we can easily write a solution for the halting
problem for most programs. same as for analyzing code for
optimization. that doesn't mean you solved the problem nor have you
found a proper limit on when to stop. someone (like you! :) will always
bitch that the analysis doesn't go deeply enough for your
program. better to not even offer to do it.

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: Fri, 03 Dec 2010 01:58:46 -0600
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.9 $)
Message-Id: <Lf-dnfQDj_KrPmXRnZ2dnUVZ5tqdnZ2d@giganews.com>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.9 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    The article at:

        http://www.catb.org/~esr/faqs/smart-questions.html

    describes how to get answers from technical people in general.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://www.rehabitation.com/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume that they do 
       know and are being the "bad kind" of Lazy.

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "top-posting", "Jeopardy" (because the answer comes before the
        question), or "TOFU" (Text Over, Fullquote Under).

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan and many others on the comp.lang.perl.misc newsgroup.

-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


------------------------------

Date: Thu, 2 Dec 2010 15:10:15 -0800 (PST)
From: Robin <r@thevoid1.net>
Subject: work to heal
Message-Id: <a4cce452-c172-4688-9079-51170613513a@l17g2000yqe.googlegroups.com>

work on stuff to heal for very long periods.....-r


------------------------------

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 3226
***************************************


home help back first fref pref prev next nref lref last post