in reply to Reading parent directory path

Have you thought about storing the value in a variable instead of printing it?

Also, reading the File::Spec documentation might help you in understanding what function calls to combine to get the results you want.

I'm sure your course material covers all of this. I suggest you review your notes.