<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">use strict;
use POSIX;
use File::stat;

# returns an RFC822 timestamp.  If no argument, for right now
#
sub rfc822
{
    my $t = shift;
    $t = time unless $t;
    my $rfc822 = "%a, %d %b %G %T %Z";
    return POSIX::strftime($rfc822, localtime($t));
}

# returns the RFC822 last-modified time for a file
#
sub rfc822_file
{
    my $fn = shift;
    my $s = stat($fn);
    return &amp;rfc822($s-&gt;mtime);
}

1;
</pre></body></html>