title: error "undefined subroutine" with perl File::Copy mkpath
body: <p>I keep on getting errors on this routine for line 51 where i user the mkpath - I tried putting the File::Copy at the top of the subroutine ( line 38 )but still get error -</p>
  
  <pre><code>use warnings;
  use DBI;
  use File::Copy;
  
  unshift @INC, "/production/lib";
  require "config.pl";
  $configFile = "/production/cfg/syncUsers.cfg";
  readConfig($configFile);
  
  doBackup($prefs{passwdFile});
  
  # generatePasswdFile("tmpusers");
  # getUsers($prefs{dbUser}, $prefs{dbPass}, $prefs{dbSid});
  # copyPasswdFile($prefs{passwdFile});
  
  # doBackup - backup the existing
  sub doBackup {
  
    #use File::Copy;
    my (@theMonth, $month, $day, $year) = "";
    if (!-e $prefs{passwdFile}) {
      print "Password file: $prefs{passwdFile} does not exist.  No backup being made.\n";
    }
    else {
      print "$prefs{passwdFile} found. Performing backup.\n";
      ($mday, $mon, $year) = (localtime(time))[3 .. 5];
      @theMonth  = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
      $month     = $theMonth[$mon];
      $day       = sprintf("%02d", $mday);
      $year      = sprintf("%04d", $year + 1900);
      $backupDir = "$prefs{backupDir}/$year$month$day/webstart";
      print "$backupDir\n";
      mkpath($backupDir); # Line 51
  
      if (-e "$backupDir") {
        move($prefs{passwdFile}, $backupDir);
      }
      else {
        print "The backup directory was not created\n";
      }
      if (-e "$backupDir/etc-users") {
        print "Backup successful.  Generating file.\n";
      }
      else {
        print "Backup failed.  Exiting.\n";
        exit 1;
      }
    }
  }
  </code></pre>
  
  <p>and this is the result: </p>
  
  <pre><code>/production/web/users/etc-users1 found. Performing backup.
  /production/archive/2013Nov19/webstart
  Undefined subroutine &amp;main::mkpath called at ./testbackup.pl.seco line 51.
  </code></pre>
  
  <p>the module is on the host: </p>
  
  <pre><code>bash-3.00$ perldoc -l File::Copy
  /usr/local/perl5.8.8/lib/5.8.8/File/Copy.pm
  bash-3.00$
  </code></pre>