You're right and I learn something new all the time.

Building on this though, if you made the constants module, couldn't you 
make them subs?  I believe this is even how the use constant pragma 
functions.  Heck make it an object oriented module with static methods 
and it's even designed well.  Just a thought.

James Gray

On Friday, October 4, 2002, at 03:17  PM, David Garamond wrote:

> James Edward Gray II wrote:
>> I haven't tested it, but I'm quite sure:
>> my $p = 'Long::Package::Name';
>> $p->constant;
>> ...works as expected.  If memory serves this is even allowed under 
>> the strict pragma.  If not though, you could always localize a block 
>> with no strict 'refs' where you need it.
>
> $p->foo only works when 'foo' is a subroutine.
>
> btw, i seem to be able to use:
>
>  $tmp = "Foo::Bar::Constants";
>  print ${$tmp."::alice"};
>
> but this fails in 'strict refs'. and though a bit shorter, it's not 
> pretty either (IMO).
>
> -- 
> dave
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to