use Digest::SHA::PurePerl qw(sha1_hex); my $directory = '/Foo/bar/'; my $hash = sha1_hex($directory);