in reply to use strict;,$main::, and AUTOLOAD: Why can't we all get along?

I must say, I fail to see what you are argueing in your post.

First, you say you can replace &{$_ [0]}($_ [1]) with $main::{$_ [0]} ($_ [1]). That's only partially true, it only works if you are in the main package. You are of course still using a soft reference - and the fact that it's not halting compilation may be a bug that will be fix in a next version.

But then you start talking about AUTOLOAD, and there's where I lost it. What's the relation between AUTOLOAD and the bug exp^W^Wtechnique described above? Do you want to call the function in $AUTOLOAD after you loaded it with the technique above? Why? Isn't that why we have &goto $AUTOLOAD?

Abigail

Replies are listed 'Best First'.
Re: Re: use strict;,$main::, and AUTOLOAD: Why can't we all get along?
by hsmyers (Canon) on Jul 18, 2002 at 12:54 UTC

    I use AUTOLOAD as a debugging technique to catch as yet un-written code references. It goes away in the production version. The code references come from a parse tree produced as part of a compiler. So from my point of view, this comes down to things that are admittedly cosmetic, but as I pointed out I am somewhat helplessly compulsive hence the problem. Is the un 'Strict' performance of $main:: going away or were you referring to some thing else?

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Re^2: use strict;,$main::, and AUTOLOAD: Why can't we all get along?
by Aristotle (Chancellor) on Jul 18, 2002 at 13:21 UTC
    Why should $main::{$softref} become subject to stricture? After all, it is an obviously intentional symbolic lookup. If you forbid it, Object->$methodname() would have logically to be forbidden as well, wouldn't it? In fact, Object->method() is a symbolic lookup on a bareword; now things get tricky..

    Makeshifts last the longest.