On 1 Jul 2003 at 17:01, Ton Hospel wrote:
> In article <[EMAIL PROTECTED]>,
> "Bernie Cosell" <[EMAIL PROTECTED]> writes:
> > It is undefined behavior [even though it works currently in every version
> > of Perl] and so it IS best to avoid it. What I don't understand is why
> > the powers-that-be provide so much resistance to putting in a simple
> > 'static' declaration that would work the same way, only be defined-and-
> > legal. e.g.,:
> > sub x
> > { static $vbl ;
> > [...]
> >
> > Oh well, I guess re-opening that wound isn't much fun...
>
> It doesn't really give you anything you don't already have by writing
>
> {
> my $vbl;
> sub x {
> ....
> }
> }
"Give you anything" isn't really the point -- Perl is filled with
multiple ways to do things and the simple argument that you can do
something similar using some other mechanism is rarely determinative.
Virtually EVERY programmer knows what a simple static variable is -- and
while I do recognize [and use] a closure to get the effect of a static
variable, it is hardly as clear and simple as being able to do:
sub x
{
static $vbl;
...
and I doubt that anyone other than a fairly experienced Perl programmer
would quickly apprehend that construct as even _being_ a simple static.
But, again, this debate isn't 'fun'. sigh..
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
mailto:[EMAIL PROTECTED] Pearisburg, VA
--> Too many people, too few sheep <--