Subject: | RFE: shorter synonyms for absolute & relative files and dirs |
I find myself frequently switching to absolute pathnames. It's frustrating to have to sprinkle "->absolute" everywhere. E.g. for current directory, "dir()->absolute".
I'd love to have a shorter synonym, e.g. "abs()". relative() could also be rel(). E.g. "dir()->abs".
Another good (and easy) possibility might be to implement "absdir" and "absfile" to just wrap "dir" and "file" to return the absolute versions of each. Those functions would maintain brevity and clarity.
I thought about being able to request absolute filenames as the default rather than relative in the import of Path::Class. E.g.:
use Path::Class ':ABSOLUTE';
However, a toggle like this to the API could be a source of confusion to those later reading/maintaning the code, so I'm not sure if it's actually a good idea. (Mentioned just for completeness of my brainstorming.)