in reply to copy files to the nonpermanent directory

Are you using File::Copy? If so, change the copy statement to copy("$dir/$file","$dir1/$file") or die "Cannot copy file: $!\n"; What error message does this generate?

Arjen

Replies are listed 'Best First'.
Re: Re: copy files to the nonpermanent directory
by Nelly (Novice) on Mar 24, 2004 at 09:19 UTC
    The error message is: Unsuccessful stat on filename containing newline at C:/Perl/lib/File/Copy.pm lin e 91, <> line 2. Cannot copy file: No such file or directory. But I'm sure that the directory exists, the strings that I'm puting into $dir1 are from input, but if I'll write the same thing but without scalars, for example: my $dir1="c:\\perl\\begperl\\qa"; error message is: Cannot copy file: Bad file descriptor. Thank you very much for your response!!!!!!!!
      As the values that you are using to build your path are coming
      from a user, I would suggest that they still contain the newline character
      you will need to remove this
      chomp($path); chomp($file); $dir1 = join('\\', 'c:', $path, $file);
      Letting us see a snippet of your code will make solving your problems MUCH easier