Use Perl rather than Python for `realpath`.

Original source: http://stackoverflow.com/a/4887785