Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Replacing substrings with linksby LanX (Saint) |
on Feb 05, 2022 at 22:10 UTC ( [id://11141162]=note: print w/replies, xml ) | Need Help?? |
> Each key is a path, which is the absolute path of the value. For example: > realpath /p # Yields /a/b/c > For each value, I would like to replace the substring with the other link, if such exists. In our case, we have "/a/b/c/dt/sde/tools/em64t_SUSE/tool/0.9.0" and "/a/b/c" => "/p" , so I would like to have: You are aware that a file system can have multiple links pointing to the same "realpath", right? And if you had multiple links qualifying like an additional "/a/b" => "/q" you'd probably want to replace "/a/b/c" first to have a shorter result. This will become pretty messy without further clarification.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|