Help for this page
my $oldpath = "/foo/bar/baz"; my @path = split(/\//, $oldpath); ... $newpath .= "/".$path[$i]; } print $newpath;