A better way to set the Expires: tag

Now that we are using LWP, we have a more convinent way of setting the Expires: tag.

#get seconds-since-1970
$current_time = time();

#load the Date portion of the LWP library	
use HTTP::Date;  

#make a nicely-formatted time
$stringGMT = time2str($current_time);

print <<"EOI";
Expires: $stringGMT
Content-type: text/html

[put your HTML stuff here!]
EOI
The HTTP:Date library also includes the function str2time which converts the other way (i.e., from an ascii string (in most reasonable formats) into seconds-since-1970.)

Last modified: Wed May 15 16:11:10 DST 1996