1File::Spec::Native(3) User Contributed Perl DocumentationFile::Spec::Native(3)
2
3
4
6 File::Spec::Native - Use native OS implementation of File::Spec from a
7 subclass
8
10 version 1.004
11
13 # This serves little purpose on its own but can be useful in some situations
14
15 # For example:
16 use Path::Class 0.24;
17
18 # convert foreign file type into native type
19 # without having to know what the current OS is
20 foreign_file(Win32 => $win32_path)->as_foreign("Native");
21
22 # or to build a file-spec dynamically (possibly taking the type from input):
23 my $type = get_requested_file_spec(); # can return "Native"
24 foreign_file($type => $file_path);
25
26 # having $type be "Native" is an alternative to having to do:
27 my $file = $type ? foreign_file($type, $file_path) : file($file_path);
28
30 This module is a stupid hack to make the default File::Spec behavior
31 available from a subclass. This can be useful when using another
32 module that expects a subclass of File::Spec but you want to use the
33 current, native OS format (automatically detected by File::Spec).
34
35 For example: "as_foreign" in Path::Class (as of version 0.24) allows
36 you to translate a Path::Class object from one OS format to another.
37 However, there is no way to specify that you want to translate the path
38 into the current, native OS format without guessing at what that format
39 is (which may include peeking into @File::Spec::ISA).
40
41 This module @ISA File::Spec.
42
44 • File::Spec
45
46 • Path::Class
47
48 • <https://rt.cpan.org/Ticket/Display.html?id=49721>
49
51 Perldoc
52 You can find documentation for this module with the perldoc command.
53
54 perldoc File::Spec::Native
55
56 Websites
57 The following websites have more information about this module, and may
58 be of help to you. As always, in addition to those websites please use
59 your favorite search engine to discover more resources.
60
61 • MetaCPAN
62
63 A modern, open-source CPAN search engine, useful to view POD in
64 HTML format.
65
66 <http://metacpan.org/release/File-Spec-Native>
67
68 Bugs / Feature Requests
69 Please report any bugs or feature requests by email to
70 "bug-file-spec-native at rt.cpan.org", or through the web interface at
71 <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Spec-Native>.
72 You will be automatically notified of any progress on the request by
73 the system.
74
75 Source Code
76 <https://github.com/rwstauner/File-Spec-Native>
77
78 git clone https://github.com/rwstauner/File-Spec-Native.git
79
81 Randy Stauner <rwstauner@cpan.org>
82
84 This software is copyright (c) 2011 by Randy Stauner.
85
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88
89
90
91perl v5.32.1 2021-01-27 File::Spec::Native(3)