+#!/usr/bin/perl
+
+use File::stat;
+use strict;
+use warnings;
+
+use File::Basename;
+use File::stat;
+use MIME::Base64;
+use File::Spec;
+use File::Spec::Functions qw(rel2abs);
+
+my $datadir = dirname(rel2abs($0))."/";
+
+sub getfile
+{
+ my $fn = $datadir.(shift @_);
+ $fn = File::Spec->rel2abs( readlink($fn) ) if (-l $fn);
+ return undef unless ( -f $fn);
+ return $fn;
+}
+
+my $dir;
+opendir($dir, $datadir);
+my @links = grep { /^[^.]/ && -l $datadir.$_ } readdir($dir);
+closedir($dir);
+
+foreach my $link (@links) {
+ my $target = getfile($link);
+ next unless ( defined ($target) && -f $target);
+ next unless ( $datadir eq dirname($target)."/" );
+ system ("md5sum '$target' | tee '$target.md5sum'");
+}