On Wed, Mar 31, 2004 at 11:38:56PM +0200, Paul Johnson wrote:
> On Wed, Mar 31, 2004 at 03:23:49PM -0600, Mike Blezien wrote:
>
> > Hello,
> >
> > I need to create a dropdown list of week numbers ranging from the current
> > week number to week number 01. The week number would be obtain from a MySQL
> > database, IE: select week(curdate()); this equals 13
> >
> > and from this week#, then I need to generate a list from that week number,
> > IE. 12,11,10,09,07,...etc., down to 01
> >
> > What would be the best way in perl to do this ??
>
> How about something like:
>
> @l = map sprintf("02d", $_), reverse 1 .. $curdate - 1;
Ha! Now I'm doing it too ;-)
@l = map sprintf("%02d", $_), reverse 1 .. $curdate - 1;
( Note the addition of a % )
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>