2009/12/1 Tony Cook <tony@develop-help.com>: > On Wed, Nov 25, 2009 at 02:31:49AM -0800, Frank Wiegand wrote: >> perldoc perlrun says about -i: >> >> These sets of one-liners are equivalent: >> >> $ perl -pi -e 's/bar/baz/' fileA # overwrite current file >> $ perl -pi'*' -e 's/bar/baz/' fileA # overwrite current file >> >> But they aren't: >> >> % touch fileA >> % perl -pi -e 's/bar/baz/' fileA >> % perl -pi'*' -e 's/bar/baz/' fileA >> Can't do inplace edit on fileA: File exists. >> >> This is broken at least since 5.6.2 and still in 5.11.2. > > I'm kind of tempted to call this a documentation bug, since supporting > it might have people expecting: > > ln -s . foo > perl -pi'foo/*' -e '...' > > to work. > > But I've attached a patch that fixes the immediate problem. Thanks, applied.Thread Previous | Thread Next