in reply to Apply mtime and atime to new file

I am doing major edits to sgml files through regex. Basically I am taking the original file as a string, editing the string and then printing the string to a new file. I want the new file to retain the modified and accessed dates of the original file. Here's my attempt so far:
Yes? Is there a question that I am missing?

One remark though, your code is doing 5 different system calls (open, close, unlink, rename, utime) of which you are not checking whether they succeed or not. Each of them might fail.

Abigail

Replies are listed 'Best First'.
Re: Re: Apply mtime and atime to new file
by APA_Perl (Novice) on Dec 08, 2003 at 16:55 UTC

    |Yes? Is there a question that I am missing?

    Yeap, the question was "will this work" or "why doesn't this work"? I am really new (suprise) at Perl, programming, and Perl Monks forums. I'm sorry for asking questions strangely.

    I do mean well.

      Yeap, the question was "will this work" or "why doesn't this work"?
      Given that you have the code, why bother asking "will this work" if you can just run the code and see whether it works?

      As for "why doesn't this work", you get the most out of the question if you specify what happened, and what you expected it to happen. Otherwise, people just have to guess what went wrong, meaning that people who could be answering your question might waste time, or just move on and answer a question of someone who took the trouble in supplying that information.

      Abigail