smita_k has asked for the wisdom of the Perl Monks concerning the following question:

Move function of Perl is not working with UNC :( Please help. Need to move files from 1 server to another

 $rc = move($sourceDir."\\".$file, $destinationDir."\\".$file);

Replies are listed 'Best First'.
Re: Move function not working with UNC
by Corion (Patriarch) on Sep 06, 2018 at 07:26 UTC

    Hello and welcome!

    See also Reaped: move is not working with UNC, which might have been asked by you already.

    You will need to write a short program that copies the files between the servers and then deletes them.

    As you don't show us what code you have already written, it's hard to suggest anything concrete, but your code will likely involve File::Find, File::Copy and unlink.

Re: Move function not working with UNC
by Lotus1 (Vicar) on Sep 06, 2018 at 17:13 UTC

    Try this :

    move($sourceDir."\\".$file, $destinationDir."\\".$file) or die "move: $!\n";

    It's most likely that you don't have the double backslashes ("\\\\") at the beginning of the paths. Forward slashes are easier to deal with and work with File::Copy. Also refer to -X for file tests. Test if the file exists so you know you have the path set up correctly before attempting to move it.