use strict; use warnings; use XML::Twig; use File::Spec (qw/canonpath/); print File::Spec->canonpath ('c:\\x/y\\z/../../p/q\\r.txt');