Sterin, Ilya writes:
: How would we then create a inner block scoped variable, as for counters
: or other variables not needed passed the scope.  The only way would be
: to increment within the block itself.

The only way to declare a lexical variable outside a block for use only
inside the block is to declare it as a formal parameter via C<sub> or
C<< -> >>  Inside the block you use C<my> as usual.  However, you can
always increment such a variable:

    while 1 {
        my $i; FIRST { $i = 0 }; NEXT { $i++ }
    }

Hmm, maybe we do need a FIRST to go with the LAST...

: Is there a reason why we can't have behavior defined on whether or not
: pareths are used.  With pareths it's scope block, without, outter scope?

That would be the first time parens ever indicated that sort of thing
in Perl.  And I'd rather not overload the meaning of parens any more
than it already is.

Larry

Reply via email to