Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am a little confused with perl subroutines.
Can anybody explains the differences in ways to call subroutines for me.
what is the best practice to use, when and why?sub Test { my ($X,$Y) = @_; return "Hello $X and $Y\n"; } print "With &\n"; print &Test('name 1','name 2'); print "Without &\n"; print Test('name 1','name 2'); print "Without brackets\n"; print Test 'name 1','name 2';
Thanks in advance
Back to
Seekers of Perl Wisdom