in reply to What is wrong with this code?

My guess as to why it doesn't work would be the space in the pathname. As others have mentioned, there are "safer" and more portable ways to handle filenames - one more not yet mentioned is Path::Class.