Scope of variables in a function
Andrew Beverley
andy at andybev.com
Sat Jun 1 20:13:04 BST 2013
On Sat, 2013-06-01 at 19:15 +0100, Anthony Lucas wrote:
> > Thanks for that. Obviously I should have RTM, but it does seem strange
> > that something that is not recommended does not produce any sort of
> > warnings.
>
> It's not that it's not recommended, it's just that it's usually not what
> you meant. There's nothing objectively wrong with not reinitialising a
> variable on every call into your function.
>From the previously quoted perlsyn text "The behaviour ... is
undefined... Future versions of perl might do something different from
the version of perl you try it out on."
That says to me that it should never be used?
Andy
More information about the london.pm
mailing list