Hello,
I'm not too good with Perl, so a problem like this stumbles me. I have a vision on how to do this but was wondering if there would be any other easier ways. I'm pretty sure there is, so I wish to seek wisdom from fellow monks here.
I have a directory called "images". Here is a example of what image files would be in this directory:
2005-03-05.jpg
<b>2005-04-25.jpg
2005-04-27.jpg
2005-04-29.jpg
2005-05-01.jpg
2005-05-05.jpg</b>
2005-02-10.jpg
Now I have a script that displays an image from this directory according to the current date and the date range that was inputted inside a database.
Lets say the date range was 2005-04-25 to 2005-05-05, and todays date was 2005-04-28, then that means I want it to display the image file named 2005-04-27.jpg. If todays date was 2005-04-29, then it will display the image file named 2005-04-29.jpg instead.
This image display is basically an automation display of a image file according to the current date and whether its in the date range specified.
The code I'm envisioning is a to create an array of values of image file names according to the date range specified. Then do a foreach statement on that array to check which image file to display.
Am I on the right track?
Thanks,
Elrold
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.