OK i could help you but i dont know what your data looks like.
can you post an example bit your your data?
but other wise it may be the most simple to store the data as
the result of the time() function. that way you have the number of
seconds since the epoc.
Perl then provides you with a simple way to convert that into
plain text.
so here is an example of what im talking about .....
$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.............
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
little_mistress@mainhall.com
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.