Alex Harris wrote:
> 
> if I use the following to get the date of a file:
>     use File::stat;
>     use Time::localtime;
>     $date_string = ctime(stat($file)->mtime);
>     print "file $file updated at $date_string\n";
> 
> I get:
>    Mon Jan  7 10:21:21 2002
> 
> Now I want to compare another file date to this one getting the date the
> same way but I don't understand the following example:
> 
> [snip]

my $date1 = stat( $file1 )->mtime;
my $date2 = stat( $file2 )->mtime;

if ( $date1 < $date2 ) {
    print "$file1 is older than $file2\n";
    }
elsif ( $date2 < $date1 ) {
    print "$file2 is older than $file1\n";
    }
else {
    print "$file1 and $file2 were modified at the same time.\n";
    }


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to