Re: open()



On 10/27/06, Klaus Jantzen <kdjantzen@xxxxxxxxxxx> wrote:

Why should one separate the ">" etc. from the file name?

Mostly, if the file name might be user-supplied. Perl's open() treats
a number of characters as magical, potentially invoking a shell or
another program -- but that's dangerous power in untrusted hands. The
three-arg open() was invented to close that security hole. If you can
trust the filename string, there's nothing wrong with using Perl's
open() the "traditional" two-arg way.

Cheers!

--Tom Phoenix
Stonehenge Perl Training
.