in reply to Re: Perl's Bad Ideas
in thread Perl's Bad Ideas
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl's Bad Ideas
by YuckFoo (Abbot) on Apr 06, 2002 at 20:52 UTC | |
by Dominus (Parson) on Apr 07, 2002 at 00:00 UTC | |
by belg4mit (Prior) on Apr 07, 2002 at 00:10 UTC | |
by Dominus (Parson) on Apr 07, 2002 at 00:30 UTC | |
by belg4mit (Prior) on Apr 07, 2002 at 00:41 UTC | |
|