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