in reply to Re: Re: Perl's Bad Ideas
in thread Perl's Bad Ideas
If $x is a filehandle, of course I am printing contents of $y to filehandle $x.You seem to have missed the point here. That's probably my fault.
You said "If $x is a filehandle...". How can you tell if $x is a filehandle? (Answer: You can't.)
If Perl is smart enough to know it's a filehandle, why isn't it smart enough to use it as such?Perl doesn't have any magic way to know it's a filehandle. That's why you have to leave off the comma. The missing comma says "By the way, this is a filehandle."
Let's try a slightly more concrete example:
Now what?$x = 'STDERR'; $y = "I like pie.\n" print $x, $y;
--
Mark Dominus
Perl Paraphernalia
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl's Bad Ideas
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 | |
by Dominus (Parson) on Apr 07, 2002 at 00:56 UTC |