Ralf Wildenhues <[EMAIL PROTECTED]> writes:

> This includes escaping of characters special to the shell as well as
> special to Perl, e.g., leading `<' or `>'.  For example, when $file
> starts with `>', `open ">$file"' wrongly tries to append to a different
> file.

The best fix here from a Perl perspective would be to use the
three-argument form of open everywhere rather than just appending
characters to the file name argument of the two-argument form.  You then
require Perl 5.006, but that's not a bad requirement these days.

When using the two-argument form, files with leading or trailing
whitespace will still cause you problems even with an explicit mode
character always prepended.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>


Reply via email to