how do I find two parent directories up in perl?

Viewed 141

I have a path: /path/to/here/file.txt.

I want to get /path/to/

Using

 my ($file, $dir) = fileparse($fullPath);

I can get file.txt and /path/to/here/

How do I get just /path/to/?

2 Answers
Related