[32545] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3810 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 5 09:09:38 2012

Date: Mon, 5 Nov 2012 06:09:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 5 Nov 2012     Volume: 11 Number: 3810

Today's topics:
    Re: Trampoline sub <derykus@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 4 Nov 2012 15:22:39 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: Trampoline sub
Message-Id: <2d84331c-7fea-47dc-b68e-913519950b9b@googlegroups.com>

On Sunday, November 4, 2012 11:05:58 AM UTC-8, Tim McDaniel wrote:
> In article <k76dts$pu9$1@reader1.panix.com>,
> 
> Tim McDaniel <tmcd@panix.com> wrote:
> 
> >I think all the possibilities are
> 
> >    *OldModule::OldSub = \&NewModule::NewSub;
> 
> >    sub OldModule::OldSub { goto &NewModule::NewSub; }
> 
> >    sub OldModule::OldSub { &NewModule::NewSub; }
> 
> >    sub OldModule::OldSub { NewModule::NewSub(@_); }
> 
> 
> 
> and of course
> 
>     *OldModule::OldSub = *NewModule::NewSub;
> 

Ok, forget 'local' on the latter but since you're 
just concerned with the sub, it'd  still be better
practice to alias only the CODE slot:


   *OldModule::OldSub = \&NewMoldule::NewSub;


Othewise, for instance, an existing SCALAR slot 
such as 'OldSub' or 'foo' or whatever the sub's
called could collide. 


-- 
Charles DeRykus



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3810
***************************************


home help back first fref pref prev next nref lref last post