shekarkcb has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to write a code that would take next 5 files, and a previous according to the hour. My files are in
file_00.txt, file_01.txt , file_02.txt, file_03.txt
naming convention ( file_HOUR.txt ). If the Hour is 0 ( i.e midnight) i need to take file_23.txt, file_00.txt, file_01.txt, file_02.txt, file_03.txt, file_04.txt. - and accordingly for subsequent hours. But i am kind of stuck of putting up this logic, my so far code is
pointers to this is greatly helpful.use Data::Dumper; @array_time=localtime; if ( $array_time[2] == 0 ) { print "Now the time is |$array_time[2]|..\n"; $firstFile = "file_"."23.txt"; print "First File will be |$firstFile|\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getting next 5 files according to hour
by JavaFan (Canon) on Feb 21, 2012 at 07:23 UTC | |
by shekarkcb (Beadle) on Feb 21, 2012 at 07:36 UTC | |
by JavaFan (Canon) on Feb 21, 2012 at 09:29 UTC | |
by pemungkah (Priest) on Feb 21, 2012 at 16:42 UTC | |
by shekarkcb (Beadle) on Feb 22, 2012 at 08:50 UTC | |
by bimleshsharma (Beadle) on Feb 21, 2012 at 13:06 UTC |