I'm really not loving Perl but I've got to use it for my current task.
Here is my problem... I have three strings, that make up elements of a full directory path (windows, but needs to work on *nix too). For example...
$root = "c:\\checkout\\omega";
$client = "abc\\mainline";
$build = "omega\\abc\\mainline\\host\\make";
I want to combine these to make a full path e.g.
"c:\\checkout\\omega\\abc\\mainline\\host\\make"
But there is overlap between the $build string and the $root
and/or $client
string. How can I combine these to get the full path and ignore the overlapping. $client
can probably be ignored in this example but there are other cases where $build may
overlap $client
but not $root
.
I can think of lots horrible messy ways to implement it but I assume (perhaps wrongly) that there is a simple, clean and maybe even elegant way of doing this since Perl is mainly about the text manipulation.
Some kind of string OR operation maybe. I foolishly tried...
($root . $client) | $build
But it is a bitwise operation and the result is junk!