Y at-il une fonction f
dire (dans la base Perl ou une bibliothèque) tel que:concaténation annuaire Perl
f("https://stackoverflow.com/a/b/c", "./d") == "https://stackoverflow.com/a/b/c/d"
f("https://stackoverflow.com/a/b/c", "../d") == "https://stackoverflow.com/a/b/d"
f("https://stackoverflow.com/a/b/c", "/d") == "/d"
Fondamentalement, il renvoie le répertoire qui résulterait de façon répétée cd
ing.
Vous pouvez écrire votre propre! –
Nul s'il y en a un intégré, mais ce serait facile d'en faire un. : P '$ pwd = $ ENV {PWD}; chdir $ path1; chdir $ path2; $ resultat = $ ENV {PWD}; chdir $ pwd; ' – cHao
duplication possible de [http://stackoverflow.com/questions/6579495/how-to-concatenate-pathname-and-relative-pathname](http://stackoverflow.com/questions/6579495/how -to-concatenate-pathname-et-relative-pathname) – uba