on a *nix system, any file created automatically get's a timestamp... as
far as 'touch' goes, this might well be over kill in this case.
concider the following:
open O, ">foo.txt";
this creates 'foo.txt' and opens it for writing.
now, if you dont write anything to it, that's your choice... and you'll
end up with a 0 byte file called foo.txt, properly (unix) timestamped
or, if you want to name your file after the current time, you could use
something like:
my $t = time;
open O, ">$t";
in effect, this does the same as touch, and avoids nasty system calls...
of course, if you need return values or checks, you could add an 'or die
"file not created"' or even eval it...
hope this helps
Jos Boumans
[EMAIL PROTECTED] wrote:
> I'm trying to write a script that opens a file, then matches some
> characters, and then writes the output to an HTML file on the fly.
>
> Everything works except I also want to timestamp a file with touch
> in the same perl script and that doesn't work. Touch is active as I
> can 'touch' the file on the console. But my code inside the perl
> script doesn't work.
>
> Here is the latest statements that I tried.
>
> system 'touch', 'test0612a.shtml';
>
> exec 'touch', 'test0612a.shtml';
>
> Thanks for any help,
> ~