Gossamer Forum
Home : Products : Gossamer Links : Discussions :

simple $day question

Quote Reply
simple $day question
hi GT'ers

the goal of the following global sub is to return either 01 (if the day is 01-14) or 15 (if the day is 15 or greater), and it works just fine:

sub {
my $date = GT::Date::date_get();
my $day = substr($date, 8,2);
my $part = ($day < 15 ? '01' : '15');
return {check_date => $part};
}

now, however, i want it to return either 01 (if day is 01-07), 08 (if day is 08-14), 15 (if day is 15-21), or 22 (if day is greater than 21)... any ideas on how i need to change my $part ???? i'm failing at it... thanks for helping a novice learn

-kysa
Subject Author Views Date
Thread simple $day question kysa 2236 Jan 21, 2005, 5:16 PM
Thread Re: [kysa] simple $day question
kysa 2170 Jan 21, 2005, 9:11 PM
Thread Re: [kysa] simple $day question
kysa 2172 Jan 21, 2005, 9:21 PM
Thread Re: [kysa] simple $day question
Andy 2177 Jan 22, 2005, 12:35 AM
Post Re: [Andy] simple $day question
kysa 2157 Jan 22, 2005, 8:30 AM