On Wed, Jul 02, 2003 at 07:58:03AM +0100, Pense, Joachim wrote:
>
> Even if you are right and not virtually every programmer knows of the
> concept, in my view it is a concept that anyone who started using it
> probably will not like to miss in the future (well, at least it used to be
> my favorite feature of C classic). It enables you to declare variables at
> the latest possible point (the first usage) which is a programming style
> that is often recommended in the Perl community. I think it is easy to see
> which version looks elegant and which one kludgy:
>
> (Quoted from earlier in the thread, reformatted:)
>
> | sub x {
> | static $vbl ;
> | ...
> |
>
> | {
> | my $vbl;
> | sub x {
> | ...
> | }
> | }
IMO, not doubt the latter looks far more elegant - as that enables your
'static' variable to be shared with more than one function. Something
you can't do with a 'static' declared variable inside a function.
Abigail