in reply to Re: having horrors untainting a path string for moving a file
in thread having horrors untainting a path string for moving a file

The OP mentioned this may have to work across different mount points, and rename can't do that. And this is why he can't use File::Copy's mv since under the hood that also uses rename.

Replies are listed 'Best First'.
Re^3: having horrors untainting a path string for moving a file
by ikegami (Patriarch) on Mar 14, 2006 at 18:50 UTC
    Me bad! I didn't notice that. In that case,
    File::Copy::move($a{from}, $a{to});
    or
    system('/bin/mv', $a{from}, $a{to});
    is much safer! He'll might still need to untaint $ENV{PATH} (by setting it to a known value), but there's no shell involved. mv sets the error result, so that can be used instead of capturing the output.