my $p = FP::Path->new_from_string ("a/../b/C")
is $p->string, 'a/../b/C/../d/../e';
is $p->xclean->string, 'b/e';
ok not equal($p->xclean, $p);
ok equal($p->xclean, $p->xclean); # obviously, assuming purity
# or use the (evil?) constructor function export feature:
use FP::Path "path";
is path("a/../b/C")->xclean->string, "b/C";
Not really sure why I'm creating something from scratch here? It might be cleaner:
This doesn't do I/O (access the file system, ask the system for the hostname, etc.), and it doesn't resolve ".." unless when told to (`perhaps_clean_dotdot` and derived methods (incl. `xclean` etc.)).
Port / merge with https://github.com/pflanze/chj-schemelib/blob/master/cj-posixpath.scm ?
Provide `string_to_path` constructor function?
Implements: FP::Abstract::Show, FP::Abstract::Pure
FP::Path::t for the test suite
This is alpha software! Read the status section in the package README or on the website.
To install FunctionalPerl, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.