title: Perl Opendir with login?
body: <p>I currently have one function to copy some files from the network drive and paste it to my local server folder.</p>
  
  <pre><code>sub getNetworkDrive {
      #my $dir="\\\\network\\Path";
      my ($dir, $move_to) = @_;
  
      opendir(DIR, $dir) or die "can't opendir $dir: $! \n";
  
      my @files=readdir(DIR);
      closedir DIR;
  
      foreach my $file (@files) 
      {
          if (-f "$dir$file") 
          {  
              #my $move_to="C:\\Projects\\Perl\\download\\$file";
              my $move_from = "$dir$file";
              copy($move_from, $move_to) or die "Copy Failed: $!";
              print "File: $file : has been downloaded Successfully\n";
          }
      }
  }
  </code></pre>
  
  <p>It works perfectly fine when I use my user to execute the script, because my user have access to the network drive. </p>
  
  <p>I would like to make this script to prompt for an authorized username and password whenever the script is runned. </p>
  
  <p>So does Opendir accept username and password as parameter? if it doesn't then what is my alternative?</p>