http://www.perlmonks.org?node_id=124443


in reply to Re: (tye)Re: When to use Prototypes?
in thread When to use Prototypes?

When you use an empty prototype (no args) for constants, the parser then knows not to interpret anything that follows as arguments for to that sub:

sub LOW_PRE_PI {3.141} sub HI_POST_PI () {3.142} my @n_proto = (1, LOW_PRE_PI + 5, 11, 15); my @y_proto = (1, HI_POST_PI + 5, 11, 15); print "@n_proto\n@y_proto"; __END__ Output: 1 3.141 1 8.142 11 15

In the first case, everything following the unprototyped version is taken as an argument list for the subroutine.