On Thu, 28 Sep 2000, Steve Fink wrote:
> Tom Christiansen wrote:
> >
> > As we sneak under the wire here, I'm hoping someone
> > has posted an RFC that alters the meaning of my/local.
> > It's very hard to explain as is. my is fine, but local
> > should be changed to something like "temporary" (yes, that
> > is supposed to be annoying to type) or "dynamic".
>
> my's runtime/compile-time schizophrenia is rather bizarre too. I'd like
>
> my $x if 0;
>
> to be equivalent to
>
> my $x;
>
Why? Do you mean that you want $x to be created/instantiated even if the
boolean clause is false (but could have been true)? In an if/then blcok
the scalar would be scoped locally and so would be irrelevant if the
boolean clause evaluated evaluated to false. As it is, it is kind of
strange that the scope of $x in your statement isn't bound in the if/then
structure.
-Adam
btw: I am guessing that you usually write that
my $x = $y if 0/1;
Which could be done slighlty safer
my $x = 0/1 ? $y : 0; # or undef