Re: Transform my algorithm in perl. Ideas?

2007-09-05 Thread Shams Fantar
Gunnar Hjalmarsson wrote: Shams Fantar wrote: Gunnar Hjalmarsson wrote: opendir my $d, $dir or die $!; my @oldfiles = grep -f "$dir/$_" && -M _ > 10, readdir $d; if ( @oldfiles ) { # do something } Thank you for this solution, but I would pref

Re: Transform my algorithm in perl. Ideas?

2007-09-04 Thread Shams Fantar
Tom Phoenix wrote: On 9/4/07, Shams Fantar <[EMAIL PROTECTED]> wrote: The mtime, atime and ctime functions don't exist in the perl documentation, normal? :) That's right. In Perl, we access those three timestamps in more than one way, but normally not by a function wi

Re: Transform my algorithm in perl. Ideas?

2007-09-04 Thread Shams Fantar
yitzle wrote: On 9/4/07, Shams Fantar <[EMAIL PROTECTED]> wrote: The mtime, atime and ctime functions don't exist in the perl documentation, normal? :) Without documentation, I cannot use mtime... Regards, -- Shams Fantar (http://snurf.info) You retrive those values us

Re: Transform my algorithm in perl. Ideas?

2007-09-04 Thread Shams Fantar
Gunnar Hjalmarsson wrote: Shams Fantar wrote: Here is the algorithm : "If there is a file in this directory which is old likewise of 10 days, to delete it or else, do nothing." Do you have ideas to say "If there is a file which is old likewise of 10 days" in perl?

Re: Transform my algorithm in perl. Ideas?

2007-09-04 Thread Shams Fantar
Tom Phoenix wrote: On 9/3/07, Shams Fantar <[EMAIL PROTECTED]> wrote: Do you have ideas to say "If there is a file which is old likewise of 10 days" in perl? There are three timestamps that can mean the age of a file: the mtime, atime, and ctime. If you want to know

Transform my algorithm in perl. Ideas?

2007-09-03 Thread Shams Fantar
perl? Best regards, -- Shams Fantar (http://snurf.info) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Adriano Ferreira wrote: On 9/3/07, Shams Fantar <[EMAIL PROTECTED]> wrote: Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this fun

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Jeff Pang wrote: 2007/9/3, Shams Fantar <[EMAIL PROTECTED]>: Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime("%y%m%d %H:%M",localtime); ' 070903 21:51

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
d with the Shell function ? [2] : http://perldoc.perl.org/Shell.html And for this question ? Regards, -- Shams Fantar (http://snurf.info) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
;m a beginner with perl... :-) Thanks ! -- Shams Fantar (http://snurf.info) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/