Help for this page
$filename =~ s/\/[\/]+/\//;
# Used a delimiter other than '/' to avoid escaping '/'. $p =~ s!//+!/!g;
$p = '/vobs/synergy_core_apps/code/../code/personalize/src'; ... $p =~ s{ ([^/]+) /[.]{2}/ \1 } /$1/gx; print 'after: ' , $p , "\n";