A Suggestion (please read and respond)

Just van Rossum just at letterror.com
Tue Oct 31 03:20:30 EST 2000


bowman wrote:
> 
> Courageous <jkraska1 at san.rr.com> wrote:
> 
> !Scripting languages don't require that someone declare a variable.
> 
> Perl doesn't require a declaration, but does offer the option with
> 'use strict;'. Then, for instance, a variable must be introduced with
> 'my' or an error will be flagged.
> 
> Does this help? Yes, it has saved me grief when I try to use $foobar,
> but 20 lines back I said I would use 'my $fubar;'.  OTOH, you can get
> pretty sick of 'my', even with the 'my ($this, $that, $and, $them);'
> construct.

But I don't think you can compare Perl to Python in this respect. In Perl,
if you _don't_ use strict, you don't even get a NameError if you try to
use a variable which hasn't been initialized/declared, so it's much more
needed in Perl than it'll ever be in Python. (I hope I got that right,
I'm not a Perler after all...)

Just



More information about the Python-list mailing list