in reply to Re: What are the brackets in this for ?
in thread What are the brackets in this for ?
Not only that, but you can leave off the parens for the prototyped sub. Otherwise you would have to write FOO() instead of FOO.
This is usually done in situations where you would use #define in a C program to introduce a constant. In C, you would write
#define FOO 1
and then you could use FOO in your program and it would be the same as if you had written a literal 1. Creating a Perl sub with a prototype lets you write FOO, which looks like a constant, instead of FOO(), which looks like a sub call.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What are the brackets in this for ?
by gellyfish (Monsignor) on May 22, 2006 at 14:27 UTC | |
|
Re^3: What are the brackets in this for ?
by blazar (Canon) on May 22, 2006 at 14:24 UTC |