in reply to Re^2: More Macro work...out to export a definition to next-outer level?
in thread More Macro work...out to export a definition to next-outer level?
You say that the above isn't satisfactory for 'singletons'.
Because you're using two screens of fragile and complicated code to replace two lines of code.
To invoke the code, I called a sub 'instance_vars', that was in a begin block.
No, it's not in a BEGIN block. The sub's definition is in a BEGIN block, but I already indicates how that's useless.
Aren't they global variables to each package that are initialized only once
No, they're initialised by the constructor, any number of times.
and then retain their value as global variables in each package (or accessible via package::var) from without the package?
That may be, but you access them via method calls.
I think you are showing me an alternate way of doing what I'm doing, but I don't think it's answering my question
I did. Like I said, you called it too late. You only call class_vars after you try to compile the code that uses them. All I did was made a change to call it earlier.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: More Macro work...out to export a definition to next-outer level?
by perl-diddler (Chaplain) on Oct 01, 2010 at 09:20 UTC | |
by ikegami (Patriarch) on Oct 01, 2010 at 16:22 UTC | |
by ikegami (Patriarch) on Oct 01, 2010 at 16:19 UTC | |
by perl-diddler (Chaplain) on Oct 03, 2010 at 15:45 UTC |