Re: function alias

2019-09-04 Thread Paul Johnson
On Wed, Sep 04, 2019 at 02:17:36PM +0800, Wesley Peng via beginners wrote: > Hello, This is actually two different questions with two different answers: > How to make a function alias in perl? $ perl -E 'sub b { say 67 } *says = \&b; says(83)' 67 $ > for ex

Re: function alias

2019-09-04 Thread Andy Bach
As an aside, Perl 5.10 and up, you can get the "say" command by enabling extended functions: perl -E 'say "hi mom" ' hi mom\n https://perlmaven.com/what-is-new-in-perl-5.10--say-defined-or-state a On Wed, Sep 4, 2019 at 1:08 PM Andy Bach wrote: > > > for example, says() is alias to print(). > >

Re: function alias

2019-09-04 Thread Andy Bach
> for example, says() is alias to print(). sub says { print "$_\n" foreach @_; } On Wed, Sep 4, 2019 at 1:17 AM Wesley Peng via beginners wrote: > > Hello, > > How to make a function alias in perl? for example, says() is alias to > print(). > > thanks. > > -- > To unsubscribe, e-mail: begin

Re: function alias

2019-09-04 Thread Hao Wu
https://stackoverflow.com/questions/4512094/aliasing-a-function-in-perl On Wed, Sep 4, 2019 at 2:17 PM Wesley Peng via beginners wrote: > Hello, > > How to make a function alias in perl? for example, says() is alias to > print(). > > thanks. > > -- > To unsubscribe, e-mail: beginners-unsubscr...