#!/usr/local/bin/perl

&dateheader("Date", &mtime("@ARGV"));
print "From: Roman Czyborra <czyborra\@cs.tu-berlin.de>\n\n", <ARGV>;

sub mtime { (stat (@_[0])) [9]; }

sub threeletters { substr (@_[0], 3 * @_[1], 3); }

sub dateheader {

    local ($header, $time) = @_;
    local ($sec,$min,$hour,$mday,$mon,
	   $year,$wday,$yday,$isdst) = gmtime($time);

    printf ("%s: %s, %02d %s %04d %02d:%02d:%02d GMT\n", $header,
	     &threeletters ('SunMonTueWedThuFriSat', $wday), $mday, 
	     &threeletters ('JanFebMarAprMayJunJulAugSepOctNovDec', $mon),
	     1900 + $year, $hour, $min, $sec);

}
