in reply to filesystem path concatenation
What toolic said but you're better off in general, I argue, reaching for a module like Path::Tiny.
use strictures; use Path::Tiny; my $root = "some/place"; my $name = "somefile.ook"; my $path = path( $root, $name ); print $path, $/; print $path->relative("some"), $/; print $path->absolute, $/;
There are many advantages to this style especially in code that will grow; reading, writing, iterating, relative, absolute... all kinds of fun made simple and easy for others to follow when they read your code. (update: added a missing comma.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: filesystem path concatenation
by RichardK (Parson) on Sep 28, 2015 at 14:58 UTC | |
by Your Mother (Archbishop) on Sep 28, 2015 at 22:52 UTC | |
by noname (Sexton) on Sep 29, 2015 at 09:15 UTC | |
by locked_user sundialsvc4 (Abbot) on Sep 28, 2015 at 20:14 UTC |