wml::sup::path(3)
π wml::sup::path π
ok so bestie, welcome to wml::sup::path(3) β the EN Tools era, EN Tools vibes only β¨ this is the page where we make filesystem paths make sense, no cap.
β¨ NAME β¨
wml::sup::path β Filesystem Path Manipulation π£οΈ (yes literally, that's the whole job, and she eats every time)
π SYNOPSIS π
first you gotta pull her in:
#use wml::sup::path
then it's giving three little one-liners that do the absolute most:
<: $relpath = relpath($from, $to); :>
<: $path = canonpath($path); :>
<: $url = canonurl($url); :>
look at that alignment π symmetrical, iconic, the moment.
π¦ DESCRIPTION π¦
so this include file ships the Perl functions relpath, canonpath and canonurl π«Ά and what they do is calculate relative and canonical paths/urls. that's it, that's the whole personality, and honestly? obsessed.
like, for example β and this is the example, not me freestyling β the relative path from /foo/path/bar/quux to /foo/path/foobar is calculated to ../../foobar πΈ see how she climbed out of the quux folder, backed up twice, and landed right on foobar? main character energy fr fr.
and the canonical path of ./foo/./bar/../quux// is foo/quux/ π all those ./s and ../s and the double slash got cleaned up and now it's just... neat. canonpath said "not on my watch" and she ate. π₯
π AUTHOR π
this whole thing was written by the one and only:
- Ralf S. Engelschall β
rse@engelschall.comwww.engelschall.com
put some respect on the name, legend behaviour tbh π
π REQUIRES π
what she needs to run her little show:
- Internal:
P1,P3 - External:
--(nothing bestie, she's self-sufficient, highkey independent π )
π§ SEE ALSO π§
if you wanna go deeper (and you should, iykyk):
perl(1)π
π¨ quick vibe check: all those paths and urls up there are literal β don't go rewriting them in your head, copy them exactly or you WILL be lost in the directory tree like it's a corn maze π
ok that's the whole page!! EN Tools, version stamped 2020-11-29, and the manual is wml::sup::path(3) in section 3 π mwah, go manipulate some paths bestie, you got this β¨ππ¦
π¦ where this page comes from
- debian bookworm: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- debian trixie: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu jammy: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu noble: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu questing: wml 2.32.0~ds1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms