Hello Benoit, * Benoit Sigoure wrote on Sun, Dec 16, 2007 at 02:19:36PM CET: > On Dec 4, 2007, at 10:39 PM, Ralf Wildenhues wrote: >> >> - There is too much dwimmery going on in perl. I think it needs more >> than one quoting function; one for xsystem, and one for stuff like >> ... = new Autom4te::XFile "> $file" >> >> but I wouldn't know how to make it foolproof. First, if the space is >> missing after `>' and $file begins with `>', then append mode is used. >> But also, if $file begins with whitespace, that is just ignored anyway. >> Not sure whether we want to protect the user from all such kinds of >> things. > > I *guess* that Autom4te::XFile will then use either the builtin `open' or > `IO::File'. Both of them can be called with the mode specified in a > separate argument, which is safer: > new IO::File "file", "r"; > open FILEHANDLE,MODE,EXPR > > This solves the problem nicely and safely.
Well, if you're going to propose a patch that fixes this safely, and test it for Autoconf and Automake, and it doesn't require a newer Perl version for either of them, then it would be a welcome addition over my rather hackish approach at this, which consisted of adding and using quoting functions. Cheers, Ralf
