in reply to problem in checking if directory exists

Instead of using  `mkdir -p $dir` use the mkpath function in File::Path.