in reply to Yet another substitution problem

Hi,
Try this..
First problem:   $var=~ s/\/+/\//g;

Second Problem:   $var=~s/(.*?)\/(.*?)\/\.\.\/\2\/(.*)/$1\/$2\/$3/g;