title: How do I access network shares from Perl in Windows?
body: <p>How would you explore and write to windows shared directories in perl ?
  Note: I don't have the right for network drive creation on the concerned workstation.
  I tried (without results) the following :</p>
  
  <pre><code>my $ROOTDIR1 = 'c:/';
  my $ROOTDIR2 = '//server/dir1/dir2/';
  sub dtest {
    my $ROOTDIR = shift;
    warn "Testing '$ROOTDIR'.";
    opendir( SHAREFILE, "$ROOTDIR" ) or warn "1 -&gt; " . $!;
    my @files = &lt;$ROOTDIR*&gt;;
    warn ("2 -&gt; nothing !") if (!scalar @files);
    chdir $ROOTDIR or warn "3 -&gt; " . $!;
  }
  dtest($ROOTDIR1);
  dtest($ROOTDIR2);
  </code></pre>
  
  <p>But as shown by the following output : </p>
  
  <pre><code>Testing 'c:/'. at E:\test\a.pl line 5.
  Testing '//server/dir1/dir2/'. at E:\test\a.pl line 5.
  1 -&gt; No such file or directory at E:\test\a.pl line 6.
  2 -&gt; nothing ! at E:\test\a.pl line 8.
  3 -&gt; No such file or directory at E:\test\a.pl line 9.
  </code></pre>
  
  <p>None of those methods are working.</p>
  
  <p>Any idea ?</p>