in reply to Re^2: explanation of constant syntax? ()
in thread explanation of constant syntax?
Yep, constants aren't very clear in Perl... unless you write them like FOO(). It clears up what is really going on to the user.
It also clears up what is going on to Perl. Barewords are quite ambiguous in Perl. Is it a function call, a string, a reserved word, a file handle, a package name, ... ? Sometimes Perl is forced to guess and sometimes guesses wrong (just like in the original node). So I almost always add the trailing parens to make things clear to man and beast.
One exception is that I sometimes call subroutines that take arguments without the parens to get compile-time notice when I mispel the routine name. But I only do that for statements (never in the middle of an expression), because there are even more ambiguities to trip on.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: explanation of constant syntax? (clearer?)
by Aristotle (Chancellor) on Mar 20, 2004 at 19:00 UTC | |
by tye (Sage) on Mar 21, 2004 at 04:45 UTC | |
by Aristotle (Chancellor) on Mar 25, 2004 at 04:06 UTC |