in reply to Modifying cookie expire date

I wouldn't use regex to split/read the timestamp. I would use one of the date handling modules (I like DateTime or Time::Piece) and then perform the date arithmetic with the module. Then spit out the modified timestamp in the format that you want. Something like this with DateTime:
use DateTime; use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%a, %d %Y %H:%M:%S %z' ); my $dt = $strp->parse_datetime('Sat, 20 Feb 2010 01:31:52 GMT'); $dt->add(days => 1); $dt->set_formatter('%a, %d %Y %H:%M:%S %z'); my $date_string = "$dt";
Sorry: didn't see the 'cant install other modules' on my scan

Replies are listed 'Best First'.
Re^2: Modifying cookie expire date
by mellin (Scribe) on Jan 03, 2005 at 22:01 UTC
    Yes, that it is the problem. I cannot install my own modules. I need to create my own logic to this as simple as date manipulation can be. I'm starting to think it is not easy and why bother, but as always, it's never easy and still people do this by their own :)