Kelly Jones wrote:
I want foo() and bar() to do the same thing. One way to do this:

sub foo {return bar(@_);}

Is there a more clever way using \&bar and things like that?

$ perl -le'
use warnings;
use strict;

sub bar { print "in sub bar: @_" }

bar 1, 2, 3;

sub foo { goto &bar }

foo 4, 5, 6;
'
in sub bar: 1 2 3
in sub bar: 4 5 6




John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to