At 06:30 PM 1/2/02 -0500, Michael R. Wolf wrote:
> > 1), Members, please correct me if I've read Oliver wrongly.
> >
> > Normally if we declare a my $variable on a previous my $variable, the
> > previous value is taken over by the latest value like this eg :-
> > my $d = 100;
> > my $d = 2;
> > print $d; # value = 2
>
>I think that the compiler should scream here.

It does!

% perl -Mstrict -we 'my $d = 1; my $d = 2'
"my" variable $d masks earlier declaration in same scope at -e line 1.

>You're trying
>to create two variables in the same scope with the same
>name.  Bad!

Someone didn't have warnings turned on.  Bad!
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to