in reply to Tiny Perl puzzle
I realised fairly quickly that the plus would be treated as a unary operator, and thus assumed the whole thing would be effectively:
print two( 0==0 ? "true" : "false" );
... and thus Perl would die because there's no function two() defined.
But how foolish of me!! The first two becomes a file handle of course, albeit an unopened one. So the whole line ends up printing to nowhere.
Good puzzle. This sort of thing is precisely the reason various best practices have arisen.
|
|---|