Author Topic: A simple little Perl tweak!  (Read 3364 times)

idealizm

  • Posts: 13
    • View Profile
A simple little Perl tweak!
« on: September 26, 2007, 03:04:41 pm »
Hey Dean (and others),

I'm trying to tweak the email signup "cgi/signup-list.cgi" file, but I am NOT a Perl programmer by any means - I only know PHP.  I am trying to do the equivalent of this PHP code:

Code: [Select]

$weeknum = date("W", strtotime("next Tuesday"));
$modnum = $weeknum % 4;
$uselist = "3".$modnum;


How would I write this in Perl?  

Essentially, what it's doing is adding people to a certain (RSVP) list based on the week that it is.  There are 4 RSVP lists 30,31,32,33 in rotation... and the second digit of the list number is based on which week of the year (date("W")) is Next Tuesday.  If the week number, divided by four, has a remainder of 0,1,2,or 3... it goes to list 30,31,32, or 33

Anyway, long story short, I mainly need to know how to get Perl to tell me  what the week number of this week is for the next Tuesday.   Unfortunately, I don't know how to use added modules (?) like Date::Manip or whatever in Perl.   Do I need to pre-load or install these?