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

how does perl handle UNCs? i have a script on our network that has to write into another box. i only know that when you use "open()", it looks into directories of the box where the source code is. what if i want to write into another machine within the network? your kind response is deeply appreciated.

Replies are listed 'Best First'.
Re: UNCs
by $code or die (Deacon) on Aug 31, 2001 at 03:31 UTC
    Hello perlboy

    You should be able to use open(). See my Win32 UNC example.

    Error: Keyboard not attached. Press F1 to continue.
Re: UNCs
by rrwo (Friar) on Aug 31, 2001 at 08:54 UTC

    It doesn't handle them well (at least the last time I tried it on ActivePerl). Use Win32::NetResource and other Win32::* modules to access files over a Windows NT network.

      Perl handles UNCs just like any other program under Win32. When people have problems with them, it usually has to do with a poor understanding of how to use quotes in Perl.

              - tye (but my friends call me "Tye")

        The user has to be logged into the remote machine for this to work. I've found that UNCs are particularly problematic when connecting to a Novell server (Novell 3.x anyway) from Windows NT. Even when the user is logged in and UNCs work in Windows applications, they don't always work from Perl and require using a module to explicitly map a network drive to connect.