R
Rex Gustavus Adolphus
Hi!
A couple of months ago I participated in a thread "What with this open
file..."
I published parts of my code in it and that lead into a discussion
about not calling subs with & (started by Ben Morrow):
"Don't call subs with & unless you need to (here you don't)."
Well I just looked into one of the books I used to learn Perl (aptly
named "Learning Perl"(!))
Accidently the chapter about subroutines is published on the web,
see http://www.oreilly.com/catalog/lperl3/chapter/ch04.html
Quoting from the beginning of Chapter 4 Subroutines:
"The name of a subroutine is another Perl identifier (letters, digits,
and underscores, but can't start with a digit) with a
sometimes-optional ampersand (&) in front. There's a rule about when
you can omit the ampersand and when you cannot; we'll see that rule by
the end of the chapter. For now, we'll just use it every time that
it's not forbidden, which is always a safe rule"
And another quote from the end of the same chapter:
"So, the real rule to use is this one: until you know the names of all
of Perl's builtin functions, always use the ampersand on function
calls."
So now, Ben and Tassilo, you maybe understand way programmers new to
Perl uses & in subroutine calls?
Have a good weekend : )
A couple of months ago I participated in a thread "What with this open
file..."
I published parts of my code in it and that lead into a discussion
about not calling subs with & (started by Ben Morrow):
"Don't call subs with & unless you need to (here you don't)."
Well I just looked into one of the books I used to learn Perl (aptly
named "Learning Perl"(!))
Accidently the chapter about subroutines is published on the web,
see http://www.oreilly.com/catalog/lperl3/chapter/ch04.html
Quoting from the beginning of Chapter 4 Subroutines:
"The name of a subroutine is another Perl identifier (letters, digits,
and underscores, but can't start with a digit) with a
sometimes-optional ampersand (&) in front. There's a rule about when
you can omit the ampersand and when you cannot; we'll see that rule by
the end of the chapter. For now, we'll just use it every time that
it's not forbidden, which is always a safe rule"
And another quote from the end of the same chapter:
"So, the real rule to use is this one: until you know the names of all
of Perl's builtin functions, always use the ampersand on function
calls."
So now, Ben and Tassilo, you maybe understand way programmers new to
Perl uses & in subroutine calls?
Have a good weekend : )