On 8/17/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
> > see attached.
>
> And this file was supposed to demonstrate, what, exactly?
snip

I believe he was trying to demonstrate the "right way" to build an
iterator*, as opposed to the example** I used to show that, in fact, a
subroutine can be given access to a scope other than the global (even
though the function itself is globally scoped).  I don't disagree with
his sentiment that the example I showed was bad.  I even said in that
email that an anonymous subroutine was a better solution.

I think the two of you, Corey and Paul, are talking at cross-purposes.

Corey, the feature of Perl that Paul is talking demonstratively
exists, and saying that someone should "speak Perl" when you disagree
with their valid code is not productive.

Paul, while you _can_ in fact do what you say, it is a very bad idea.
It does not work  as one might expect in a loop and is better handled
by using an anonymous subroutine.  And, while I understand that you
probably felt attacked by Corey's statements, resorting to rudeness
only decreases the likeliness of pursuading other people.

It is my understanding that this list was created in response to the
perceived hostility on comp.lang.perl and the negative effect it was
thought to have on new users and their willingness to continue
learning Perl.  While I do think it is good to have non-beginner
discussions on this list (otherwise how will the beginners see the
true depth of the language), those conversations should be carried out
with care.  Disagreement is fine; being disagreeable is not.

Can we please end this exchange amicably?

* I do not think this is a good way to build an iterator, but neither
was my example.

** here is the example for reference sake.
#!/usr/bin/perl

use strict;
use warnings;

{
       my $i;
       sub iter { return $i++ }
}

my $i = 5;
print iter(), "\n";
print iter(), "\n";
print iter(), "\n";
print iter(), "\n";

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to