in reply to How do I change .. to the real filename?

Or maybe something like this ?
$filename =~ s/\/\w+\/\.\.//g;

Originally posted as a Categorized Answer.