File::...Native(3pm)
π File::Spec::Native β the manual page, but make it a group chat π
okay so this is File::Spec::Native(3pm) β a User Contributed Perl Documentation situation, bestie. buckle up, it's short but it's iconic. π
β¨ NAME β¨
File::Spec::Native β it lets you use the native OS implementation of File::Spec from a subclass. yes really, that's the whole thing. slay. π
πΈ VERSION πΈ
version 1.004 β she's stable, she's little, she's doing her best. π
π¦ SYNOPSIS π¦
okay so listen, bestie, I'm gonna give you the exact code, no cap:
# This serves little purpose on its own but can be useful in some situations
# For example:
use Path::Class 0.24;
# convert foreign file type into native type
# without having to know what the current OS is
foreign_file(Win32 => $win32_path)->as_foreign("Native");
# or to build a file-spec dynamically (possibly taking the type from input):
my $type = get_requested_file_spec(); # can return "Native"
foreign_file($type => $file_path);
# having $type be "Native" is an alternative to having to do:
my $file = $type ? foreign_file($type, $file_path) : file($file_path);
like, the way that "Native" just slots in where you'd otherwise be guessing at your own OS? main character energy fr fr. π
π DESCRIPTION π
okay so, real talk: this module is a stupid hack (their words, not mine, but I respect the honesty π) to make the default File::Spec behavior available from a subclass.
when is that useful? when you're using another module that expects a subclass of File::Spec, but you actually want the current, native OS format β the one File::Spec automatically detects for you. π§
for example: "as_foreign" in Path::Class (as of version 0.24) lets you translate a Path::Class object from one OS format to another. gorgeous. but here's the β¨problemβ¨: there's no way to say "hey, translate this path into the current, native OS format" without guessing at what that format is (and that guessing may include peeking into @File::Spec::ISA, which is giving desperate behavior tbh π).
so this module does the unglamorous but necessary thing:
This module @ISA File::Spec.
that's it. that's the trick. it just inherits. periodt. π
π SEE ALSO π
File::SpecPath::Class- <https://rt.cpan.org/Ticket/Display.html?id=49721>
π«Ά SUPPORT π«Ά
π Perldoc
you can find documentation for this module with the perldoc command. classic, iconic, always there for you:
perldoc File::Spec::Native
π Websites
the following websites have more information about this module, and may be of help to you. and as always β in addition to those websites β please use your favorite search engine to discover more resources. iykyk. π₯
- MetaCPAN
a modern, open-source CPAN search engine, useful to view POD in HTML format. lowkey the best way to read POD, no cap:
<http://metacpan.org/release/File-Spec-Native>
π Bugs / Feature Requests
please report any bugs or feature requests by email to bug-file-spec-native at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Spec-Native>. and the best part? you will be automatically notified of any progress on the request by the system. that's the group chat notif you actually want. ππ
π Source Code
<https://github.com/rwstauner/File-Spec-Native>
git clone https://github.com/rwstauner/File-Spec-Native.git
π AUTHOR π
Randy Stauner <rwstauner@cpan.org>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2011 by Randy Stauner.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking. βοΈβ¨
and that's the whole page, bestie! this was documented by perl v5.36.0 on 2022-12-09, and the manual name is File::...Native(3pm). go forth and subclass responsibly. π¦ππ
π¦ where this page comes from
- debian bookworm: libfile-spec-native-perl 1.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libfile-spec-native-perl 1.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libfile-spec-native-perl 1.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfile-spec-native-perl 1.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfile-spec-native-perl 1.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms