simonpearce
ISP
Hello,
An odd one I can't get round:
The first bit works but when I try to get Date::Calc to work with a date other than todays - it gives up!
use Date::Calc::Object qw
all);
#THIS WORKS - using today():
if ($FORM{'Renew'} eq "month"
{$newrenewdate = Date::Calc->today(), $newrenewdate += [0,1,0] };
if ($FORM{'Renew'} eq "quarter"
{$newrenewdate = Date::Calc->today(), $newrenewdate += [0,3,0] };
if ($FORM{'Renew'} eq "year"
{$newrenewdate = Date::Calc->today(), $newrenewdate += [1,0,0] };
#THIS DOESN'T! - using a variable:
$renewfromdate eq "$FORM{'OrderDate'}";
if ($FORM{'Renew'} eq "month"
{$newrenewdate = Date::Calc->$renewfromdate, $newrenewdate += [0,1,0] };
if ($FORM{'Renew'} eq "quarter"
{$newrenewdate = Date::Calc->$renewfromdate, $newrenewdate += [0,3,0] };
if ($FORM{'Renew'} eq "year"
{$newrenewdate = Date::Calc->$renewfromdate, $newrenewdate += [1,0,0] };
An odd one I can't get round:
The first bit works but when I try to get Date::Calc to work with a date other than todays - it gives up!
use Date::Calc::Object qw
#THIS WORKS - using today():
if ($FORM{'Renew'} eq "month"
if ($FORM{'Renew'} eq "quarter"
if ($FORM{'Renew'} eq "year"
#THIS DOESN'T! - using a variable:
$renewfromdate eq "$FORM{'OrderDate'}";
if ($FORM{'Renew'} eq "month"
if ($FORM{'Renew'} eq "quarter"
if ($FORM{'Renew'} eq "year"