On Mon, Apr 16, 2012 at 04:20:35PM +0200, Paul Johnson wrote: > On Mon, Apr 16, 2012 at 06:53:53AM -0700, Paul.G wrote: > > Hi All > > > > Have a question, is it good coding practice to use a & when calling a > > subroutine, or it is not required, or it doesn't matter? > > It's good practice not to use it unless you understand exactly why you > would need to use it. > I'm tempted to say +1 for a really uninformative answer :)
perldoc perlsub (http://perldoc.perl.org/perlsub.html) explains the '&' is entirely optional - except where it isn't - e.g. where you might need to check if the subroutine exists, use a reference to a subroutine rather than a direct call etc. There are provisos to the use of the '&' prefix and the documentation explains those. Regards Lesley -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/