Maybe
adjelore is right, you don't need a cookie, but just in case here's a little sample program that shows how easy it is to set and get cookies in Perl (easier that javascript, but then about anything is easier)
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
use CGI;
$q = new CGI;
($sec,$min,$hr,$mday,$mon,$yr,$wkday,$yrday,$isdst) = localtime();
$end = $min + 20;
if ($end > 59) { $end - 60; }
print "Set-Cookie: endtime = $end\n"; #set the cookie
print "Minutes to end: $min to $end\n";
#some significant pause
$cookie = $q->cookie( "endtime" ); #get the cookie
print "$cookie\n";
And please, fellow monks, don't reply that I should have used strict, etc. I know, I know.
And
ajdelore thanks for the redirect sample, I've been using another way, I'll try this one.
Brad
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.