On Fri, 13 Sep 2002, Kauffmann, Andreas wrote:
> Hy everybody in the List!
>
> I have a Problem writing a little perl application...
>
> Im a very newbie to programming and need your help :)
>
>
> The Problem is:
>
> I have a file "dev.txt" and I want to rename it once a day (with a cronjob) like
>"dev13092002.txt"
>
> So i need to rename it with a date variable.
>
> All I have at the moment is:
>
> #!/usr/bin/perl
Enable warnings and use strict, will save you a lot of
debugging time.
> $d = `date`;
Read through perldoc -f localtime
my ($day, $month, $year) = (localtime)[3,4,5];
$month++;
$year += 1900;
> $d = /pattern1(pattern2)/;
> sytem("cp test.txt test`$d`.txt");
Why are you copying when you actually want to rename the file.
perldoc -f rename
>
>
> Does anyone of you know how to do that?
>
>
> THANKS in advance!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]