Re: Subroutines and '&'
- From: merlyn@xxxxxxxxxxxxxx (Randal L. Schwartz)
- Date: Tue, 07 Aug 2007 11:32:34 -0700
"Sherm" == Sherm Pendley <spamtrap@xxxxxxxxxxx> writes:
Sherm> It *does* make a difference - if you don't know or understand what that
Sherm> difference is, or you don't specifically want the behavior specified by
Sherm> the &, you shouldn't use it.
Or, for the opposite point of view, if you have:
sub log { print STDERR localtime() . ": @_\n" }
then you better darn well invoke it as:
&log("my message");
and *not*:
log("my message"); # invokes built-in logarithm function
And until you know all the perl built-ins, you should use &. And this
is what we teach in Learning Perl.
Please don't be so quick to dismiss the value of the leading &.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Subroutines and '&'
- From: Big and Blue
- Re: Subroutines and '&'
- From: John W. Krahn
- Re: Subroutines and '&'
- From: Paul Lalli
- Re: Subroutines and '&'
- From: ~greg
- Re: Subroutines and '&'
- References:
- Subroutines and '&'
- From: Bill H
- Re: Subroutines and '&'
- From: Sherm Pendley
- Subroutines and '&'
- Prev by Date: Re: Subroutines and '&'
- Next by Date: Re: module OpenOffice::OODoc fails with Unicode characters
- Previous by thread: Re: Subroutines and '&'
- Next by thread: Re: Subroutines and '&'
- Index(es):
Relevant Pages
|