Re: make an alias to function

2010-02-16 Thread Uri Guttman
> "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-

Re: make an alias to function

2010-02-16 Thread Shawn H Corey
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_

Re: make an alias to function

2010-02-15 Thread Jeff Peng
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

Re: make an alias to function

2010-02-15 Thread Uri Guttman
> "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"