nbowden has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I wonder if anyone could explain to me what is going on here...
I am looking at a module (POE::Kernel)which has the following lines of code in it :
sub MODE_RD () { 0 } # read
sub MODE_WR () { 1 } # write
sub MODE_EX () { 2 } # exception/expedite
These look to me (possibly in my igorance), to be used for returning a number of constant values. The thing I don't understand, is why the empty brackets ? i.e. why aren't they written as :
sub MODE_RD { 0 } # read
sub MODE_WR { 1 } # write
sub MODE_EX { 2 } # exception/expedite
There's obviously something going on here that I haven't come across before, so any care to point me in the right direction ?
Thanks very much !
Nigel.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What are the brackets in this for ?
by Joost (Canon) on May 21, 2006 at 15:05 UTC | |
|
Re: What are the brackets in this for ?
by davidrw (Prior) on May 21, 2006 at 15:05 UTC | |
|
Re: What are the brackets in this for ?
by gellyfish (Monsignor) on May 22, 2006 at 09:18 UTC | |
by bunnyman (Hermit) on May 22, 2006 at 14:14 UTC | |
by gellyfish (Monsignor) on May 22, 2006 at 14:27 UTC | |
by blazar (Canon) on May 22, 2006 at 14:24 UTC |