On 02/16/2012 04:04 PM, Zefram wrote:
>> non-vivify vififies *symbol
>> exists(*symbol)<==> defined *{symbol}{GLOB} // currently nonsense
>> exists($scalar)<==> defined *{symbol}{SCALAR} // currently nonsense
>> exists(@array)<==> defined *{symbol}{ARRAY}
>> exists(%hash)<==> defined *{symbol}{HASH}
>> exists(&sub)<==> defined *{symbol}{CODE}
>
> There's a problem with the concept here. A mention of "@foo" (or with
> any of the other sigils) brings the glob into existence at compile time.
> By the time the "exists" operation runs, it's too late to avoid vivifying
> it. Now, we *could* special-case it, but I'd rather not.
What about forcing it to be run-time by using strings?
exists('*symbol');
exists('$scalar');
exists('@array');
exists('%hash');
exists('&sub');
--
Michael Peters
Plus Three, LP
Thread Previous
|
Thread Next