in reply to Re^2: strange arithmetic
in thread strange arithmetic
In Perl, functions, including built in functions like print, act like named list operators. So Perl will look for a list of terms and expressions following the name of the function. Because, Perl, ( and ) are used as list delimiters (much like quotes delimit strings), if the first thing Perl sees after the function name is (, Perl interprets that as the start of a list. The matching ) will end that list. With out the parentheses, Perl has to look for other syntactic clues to determine the end of the list. The main reason for using parentheses around the arguments to a function is to disambiguate the end of the argument list.
Making a special case for the presence of space between the function name and a ( would re-introduce the ambiguity and break a lot of existing code. Actually, it would be worse because if that ( were the beginning of a list, the matching ), while ending that list, would not be the end of arguments, which would be more confusing.
Bottom line, far better to use warnings; (and use strict;).
|
|---|