(Perl) a more sensible way to change directories