in reply to Re^2: Array ending up empty when processing more than a single file
in thread Array ending up empty when processing more than a single file
Well for the same reason as my example, the inner sub is only applied once, so only the second sub is a redefinition.
I didn't find where the fact that a given definition of a sub (except anonymous of course) will only be applied once, no matter how often the scope of its definition is entered (actually I don't think the place where a function is defined matters at all, except for namespace and during compilation), but Lexical Subroutines explains how to create what you might expect (lexically scoped function, with redefinition each time), and so implies that the normal behaviour is different.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Array ending up empty when processing more than a single file
by LanX (Saint) on Oct 05, 2017 at 17:35 UTC | |
by Your Mother (Archbishop) on Oct 05, 2017 at 18:01 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 01:36 UTC | |
by LanX (Saint) on Oct 06, 2017 at 01:57 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 08:10 UTC | |
by LanX (Saint) on Oct 06, 2017 at 08:59 UTC |