Beau E. Cox wrote:
> Hi -
> 
> How do I get the current package name? For example,
> if I have a module that starts with:
> 
> package Beau::Cool::Stuff;
> ...
> 
> and I want to give an error (die) later in this module:
> 
> ...
> die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ...
> 
> where is the 'package name variable' so I don't
> have to type 'Beau::Cool::Stuff' all over the place?
> 
> Aloha => Beau;

In addition to __PACKAGE__, you should be aware of the caller() function.
This will let you find the package of the routine that called yours. Helpful
if you want to put your error reporting routines in their own package. (cf.
Carp)

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

Reply via email to