>* David Golden <xdaveg@gmail.com> [2011-07-18 22:40]:
>> As Tom points out, there is no problem with 2-arg open if *you*
>> control all the arguments and know what you're doing. The
>> rationale for 3-arg open is (IMO) that it's less error-prone.
>2-arg open is also useful when you don’t *want* to control all
>inputs, such as giving a caller the option to ask for transparent
>decompression by piping from zcat instead of reading from a file.
No, two-arg open is perfectly fine here:
open(STDOUT, "> /dev/null")
It's all constants. We know exactly what's going on.
And
open(STDOUT, "> $fn")
is only marginally worse, because of the whitespace issues.
--tom
Thread Previous
|
Thread Next