in reply to Re: Re: Rename problem
in thread Rename problem

Does the function return an error? Does your rename name have any unusual characters in it? Are you changing directories, for example?

Replies are listed 'Best First'.
Re: Re^3: Rename problem
by Anonymous Monk on Nov 22, 2002 at 17:47 UTC
    Thanks
    Does the function return an error? no
    Does your rename name have any unusual characters in it? no
    Are you changing directories, for example? no
      The next step would be to try renaming it to something specific to try and narrow down the problem to something reproducible. For example:
      rename("archive.txt","test.shtml");
      Now, if that ended up with a file named "test", this would be very peculiar.

      Now, instead of using the rename function, try using any command-line tool you have available. There might be something wrong with your filename.

      Windows is, despite appearances, still very much DOS when it comes to certain things. In particular, you should not have filenames that are:
      • con.*
      • lpt1.*
      • aux.*
      There's others, but you get the idea. These are device names, all left over from CP/M.

      Maybe you're trying to rename to "con.shtml" and it goes all screwy?
        Thanks for your help. The solution turned out to be: my $the_old_title = "$old_title"."\.shtml"; rename("archive.txt","$the_old_title");