in reply to Re: modular file scoping (updated)
in thread modular file scoping
Thank you indeed.
"....you're asking about the my %webpaths variable, and why your three functions in package DataBank can keep using it despite the execution of the file DataBank.pm having already finished?..."
Yes, the persisting STATE of %webpaths perplexing me somewhat!.
But I take your point about more persisting going on 'under the hood' than I generally pay attention to, and I am thankful indeed that mostly I have been spared the need to. I think my problem is just explicitness (which I tend to practise stringently in terms of style). I use 'our @EXPORT_OK = qw(subx suby subz)' a lot, of course, but in that very limiting way. And with 'my' can generally see exactly its scope within the same page (aka file) I am working on. Now I am wondering if the key factor for Perl retaining the state of %webpaths is due specifically to the precedence of calls in testme.pl to subs defined in DataBank.pm, and will therefore persist while testme.pl stays alive, even though other modules which altered the state of %webpaths are themselves long dead? (That at least would satisfy my need for order!)
I am most grateful of the time and effort you put into an erudite explanation, which I really will have to study in some depth (and perhaps open my eyes to possible trajectories I have hjtherto been too nervous to explore).
Thanks again, haukex!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: modular file scoping
by haukex (Archbishop) on Oct 13, 2017 at 08:17 UTC | |
by Pstack (Scribe) on Oct 13, 2017 at 22:22 UTC | |
by haukex (Archbishop) on Oct 14, 2017 at 07:29 UTC | |
by haukex (Archbishop) on Oct 14, 2017 at 17:58 UTC | |
by Pstack (Scribe) on Oct 15, 2017 at 21:07 UTC | |
by Pstack (Scribe) on Oct 15, 2017 at 20:44 UTC |