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.

James Gray

On Friday, October 4, 2002, at 02:31  PM, David Garamond wrote:

> Timothy Johnson wrote:
>> I'm not sure if this is a GOOD idea, but I THINK you can actually get 
>> away
>> with something like this:  In your module, insert a shorter package 
>> name,
>> but keep the module in the same place. So:
>>      package Foo::Bar::Constants;
>>      #do stuff here
>>      package MyConst;
>>      $ConstantA = "My Constant";
>>      #add more constants here
>> Then you can do a 'use Foo::Bar::Constants', and then call the 
>> constants via
>> $MyConst::ConstantA;
>
> but i still want my constants to reside in Foo::Bar::Constants 
> package. it's just that sometimes, when i'm referring to the constants 
> *a lot*, i wish they were referrable with short names. but i prefer 
> not using Exporter and @EXPORT_OK.
>
> -- 
> dave
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to