in reply to Re: open file error
in thread open file error

It's File::Spec->splitpath, and you're forgetting File::Spec->splitdir.