Given what you've requested in your comment to your question, you may want to look into the subsumes
method of Path::Class::Dir
objects. Other options include Cwd::Ext::abs_path_is_in()
and Cwd::realpath()
.
Understand that this is nothing like chroot
and will have no effect on child processes, string eval
s or even Modules you load.