> "SHC" == Shawn H Corey writes:
SHC> Jeff Peng wrote:
>> Hi,
>>
>> I have a module, and I wanted to make an alias with a function in that
module.
>>
>> package abc;
>>
SHC> # declare the sub without defining it
SHC> sub init_squid_for_reverseproxy;
>> my $obj = abc-
Jeff Peng wrote:
> Hi,
>
> I have a module, and I wanted to make an alias with a function in that module.
>
> package abc;
>
# declare the sub without defining it
sub init_squid_for_reverseproxy;
> { # make an alias to another function
>no strict 'refs';
>*{__PACKAGE__::init_squid_for_
On Tue, Feb 16, 2010 at 3:40 PM, Uri Guttman wrote:
> *{__PACKAGE__::init_squid_for_reverseproxy} = \&init_reverseproxy;
> *{ __PACKAGE__ . '::init_squid_for_reverseproxy' } = \&init_reverseproxy;
>
Thanks Uri.
I really by mistake thought those two are the same stuff.
Now I got it. :)
--
J
> "JP" == Jeff Peng writes:
> "JP" == Jeff Peng writes:
JP> package abc;
JP> { # make an alias to another function
JP>no strict 'refs';
JP>*{__PACKAGE__::init_squid_for_reverseproxy} = \&init_reverseproxy;
JP> }
perl -e '*{__PACKAGE__::foo} = \&bar; print map "$_\n"