/usr/share/doc/librcs-perl/examples/dates.pl is in librcs-perl 1.05-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/local/bin/perl -w
#------------------------------------------
# Access dates hash
#------------------------------------------
use strict;
use Rcs;
#Rcs->bindir('/usr/bin');
my $obj = Rcs->new;
$obj->rcsdir("./project/RCS");
$obj->workdir("./project/src");
$obj->file("testfile");
# sort by date
my %dates_hash = $obj->dates;
my $revision;
my %dates;
foreach $revision (keys %dates_hash) {
my $date = $dates_hash{$revision};
$dates{$date}{$revision} = 1;
}
my $date;
foreach $date (reverse sort keys %dates) {
foreach $revision (keys %{ $dates{$date} }) {
my $date_str = localtime($date);
print "Revision : Date = $revision : $date_str\n";
}
}
# scalar mode returns most recent date
print "\n";
my $most_recent = localtime($obj->dates);
print "Most recent revision date = $most_recent\n";
|