I would install (if it's not on your system already) and check out the documentation for Time::Local. It will allow you to set up the date from a month, day and year, from which, you could work it out. I wrote this (baby-talk) script that would output the last day given the month (from 0-11):
Jason #!/usr/bin/perl -w use strict; use Time::Local; my ( $month, $year, $day, $timeToCompare ); print "Which month?: "; $month = <STDIN>; chomp $month; $year = (localtime)[5]; $day = 32; do { $day--; $timeToCompare = (localtime timelocal(0,0,0, $day, $month, $year))[4]; } while ( $timeToCompare != $month ); print "Last day of the month #$month is: $day\n"; __END__ ------------------------------ If memory serves me right, on Tuesday 29 January 2002 11:23, Darryl Schnell wrote: > Greeting's All, > > I am currently working on a prorate billing routine for an online form and > need a bit of guidance. The idea behind the program is to take 19.95 and > divde that by the total of remain days in the month, using the day of the > month the user filled out the form as the starting point. > > Getting the Day of Sign-Up and Calculating the cost I can handle, what I'm > not sure how to accomplish is how do I get the total of remaining days in > the month, how do I determine how many days that month has, and how do I > take into account Leap Years? > > I relaize that this should be a basically simple matter so if any one has > some documentation that I could read that might help me figure this out I > would appreciate a shove in that direction. I tried doing a search on the > web and found some Calculating Date information but was still left alittle > foggy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]