I believe that under the current proposal, any unqualified and
hitherto undeclared variables would be implicitly declared to be
lexicals in the current scope.  This is to be contrasted with the
status quo, under which such variables are implicitly dynamics in
the current package.

I am not wholly convinced this is the best of all possible ideas.
(I am willing to hear reasoning why it is, however.)

For one thing, wouldn't one rather encourage *explicit* declaration?
How is it that the conditions of "use strict" are unsatisfactory?
This makes you say either my() or our().  Wouldn't it suffice for
your purposes to make strict mode the default instead?

Another matter is that having undeclared variables all be lexicals
by default would require a fair bit of code translation, not always
straightforward and clean.  Consider the straightforward code
sequence:

    my $a = 3;
    package A;
    $x = 1 + $a;
    package B;
    $x = 2 + $a;

And how you will now have to translate that.

Or what about this one:

    perl -lane 'END{print $sum} $sum += $F[-1]'

Or even 

    BEGIN { $x = 20 } 
    print $x;

If you make lexical autodeclaration the default, it seems to me
that one could look at this as implicitly saying that Perl is to
be made less suitable for fast and convenient solution.  Perl has
always been the king of convenience.  I recognize that this hurts
in some circles because of scalability concerns.  The argument could
easily be made that favoring scalability will help this.  But the
cost to small-scale program(mer)?s must be weighed in the balance.

--tom

Reply via email to