It never made sense to me why no commas are allowed after the filehandle in a printf with parentheses. I think even if someone could explain why printf(OUT "foo\n"); is the reasonable or logical choice, I would still not be satisfied.
It's not just the reasonable, logical choice, it's pretty much the only choice. If there were a comma after the filehandle, then what would this do?
Are you printing the contents of $y to filehandle $x? Or are you printing the contents of $x and $y to stdout?print $x, $y;
This is the same old problem that you always have when there's an optional argument at the beginning of an argument list instead of at the end: How do you tell if the optional argument is there or not? Sometimes external factors allow you to tell; when there are no such external factors, you have to invent a syntactic distinction.
--
Mark Dominus
Perl Paraphernalia
In reply to Re: Perl's Bad Ideas
by Dominus
in thread Perl's Bad Ideas
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |