Re: perl use syntax help
- From: "Dave" <daveandniki@xxxxxxxxxxxx>
- Date: Sun, 20 Nov 2005 14:29:34 +0100
"nan li" <nan.li.g@xxxxxxxxx> wrote in message
news:1132472294.652684.116010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello,
> I need some help to understand the following statement:
>
> use Apache::Const -compile => 'OK';
>
> It is from the program at
> http://modperlbook.org/html/ch25_02.html. I don't know what it is doing
> here.
> Thanks a lot.
>
> Nan
>
It allows the constant to be used, but it does not import it into the
current package. It allow the following line to work:
return Apache::OK;
had the line been simply:
use Apache::Const 'OK';
the constant (subroutine) OK would have been imported into the namespace
and:
return OK
would have worked. It is not recommended to import the constants in this
second manner as they may conflict with constants imported from other
modules.
.
- References:
- perl use syntax help
- From: nan li
- perl use syntax help
- Prev by Date: Re: sprintf formating
- Next by Date: Re: perl use syntax help
- Previous by thread: perl use syntax help
- Next by thread: Re: perl use syntax help
- Index(es):
Relevant Pages
|