in reply to Another Windows Mapping Question

Evadently, there is problem copying file from a UNC path.

I don't see how it's evident, or even true.

C:\>md foo C:\>md bar C:\>copy nul foo\file 1 file(s) copied. C:\>perl -MFile::Copy -e"copy @ARGV" \\127.0.0.1\c$\foo\file \\127.0.0 +.1\c$\bar" C:\>dir /b bar file

Replies are listed 'Best First'.
Re^2: Another Windows Mapping Question
by drodinthe559 (Monk) on Sep 24, 2008 at 23:47 UTC
    How would it look in the actual script?
      #!/usr/bin/perl use strict; use warnings; use File::Copy qw( copy ); copy $ARGV[0], $ARGV[1];

      It needs error checking.

      If you need to hardcode a UNC path, you can either properly escape backslashes

      my $path = '\\\\server\\share\\dir\\file';

      or simply use forward slashes.

      my $path = '//server/share/dir/file';

      open has no problem with either.

        Thank you for your help. Could I use this to use a File::Glow on that as well?