in reply to End of Month Conversions For Date
Perl then provides you with a simple way to convert that into plain text.
so here is an example of what im talking about .....
I dont know if that will help but ... i dont know how you are storing the time. If you have any control over that at all i would store it as seconds since the epoc ... it makes things so easy$timestandard = time() - 604800; # time() will give us the number of + seconds since the epoc # time() less 604800 seconds will give us the numbe +r of seconds since the epoc 7 days ago @data=&magic_fucntion_that_opens_the_file_and_gets_the_data(); foreach $d (@data) { push(@save, $d) if $d>$timestandard; } #so now all of the entries that are valid (ie. younger than one week o +ld) are in the array @save #now we print them to the file open(SEZME, ">my_data_file.txt"); $,="\n"; print SEZME @save; close SEZME; undef($,); #the rest of the script.............
|
|---|