#!/usr/bin/perl
use strict;
use warnings;
use Digest::SHA qw( sha512 );

# Make the SHA-512 digest function self-caching...
use Memoize;
memoize('sha512');

my @scripts=`ls /media/LaCie/e3/Music/*/*.wav`;

# sort by auto-cached SHA-512 digest of scripts...
my @sorted_scripts = sort { sha512($a) cmp sha512($b) } @scripts;
foreach my $s( @sorted_scripts ){
  chomp $s;
  printf "%s %s\n", $s, sha512($s);
} printf "\n";

#thash nishe but it doesn't save the result of sha512. 


