The documentation for randfile states that if the String::Random is avaiable, it will be used. It never states that if String::Random is NOT available, it will die. Try it yourself with "$scratch_dir->randfile(1024);". Either the documentation should be fixed, String::random should be made a dependency, or the method should be changed. As it stands, randfile is useless since Directory::Scratch does not clearly mark the dependency and unexpectedly crashes if you use it and it's not present.