From: Rodent of Unusual Size <[EMAIL PROTECTED]> > Frederic Briere wrote: > > > > Sure, just pre-declare the sub, which happens at compile time: > > > > sub DOH(); > > um, i said i want to do it at run time. the module doing the > defining doesn't know who's going to be calling it, and the > callers are depending on the module to make usable constant > barewords out of the names they give it. > > so all the compile-time stuff doesn't help, which is why > i asked for a way to do it at run time.
Sorry? If I understand it right the module provides some constants and you want to give the users of the module a way to import them under a different name? Right? Then what's the problem with package Foo; use constant MY_CRAZY_NAME => 1.4787648; package main; use constant DOH => Foo::MY_CRAZY_NAME; print DOH + 2, "\n"; ? Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery