Scope of variables in a function

Anthony Lucas anthonyjlucas at gmail.com
Sat Jun 1 20:33:15 BST 2013


Relying on its _contents_ is what you shouldn't be doing. There' a
difference.


On 1 June 2013 20:13, Andrew Beverley <andy at andybev.com> wrote:

> 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?
>
>


More information about the london.pm mailing list