ts <decoux / moulon.inra.fr> wrote: > > >>>>> "B" == Ben Tilly <ben_tilly / hotmail.com> writes: > >B> I should follow up by noting that it is unwise to plan >B> on there being another foo in scope. :-) > > I've not understood, do you want to make reference to the perl construct >? > > my $m = 12; > sub toto { > my $m = 24; > } Yes. And with Perl I throw in "my" whenever I have a temporary variable on principle. That way I can guarantee a lack of unwanted programatic side effects. But I do not intentionally have multiple variables meaning different things in nested scopes. In other words I am proactively guaranteeing that the variable is private, not reactively declaring that it will be so. >B> It isn't that complex. You just created a series of >B> variables named a and b while printing, and then you >B> backed out of the stack and it reversed. The only > > It's perhaps not complex for you, because you came with a perl > background :-) In this case I think that Perl is the norm. >B> exception to that pattern is that when you assigned >B> to a by using it as an argumet in the middle of the >B> script, you didn't create another variable. So >B> there is a slight asymmetry. > > but this case will exist. The case also exists where the [] method does assignment and []= does something random. This is not an argument against having [] and []= just be normal methods with a customary usage. To strain an analogy, shoes may be provided as protection against accidental injury from stray bullets. The fact that they may be used to lock the foot in place while aiming more accurately does not render them useless for their intended purpose... :-) Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com