Start anew
[msysgit.git] / lib / perl5 / 5.6.1 / File / Spec.pm
blob3f79d74b66acacdd633c5a186c346918ebce5f60
1 package File::Spec;
3 use strict;
4 use vars qw(@ISA $VERSION);
6 $VERSION = 0.82 ;
8 my %module = (MacOS => 'Mac',
9 MSWin32 => 'Win32',
10 os2 => 'OS2',
11 VMS => 'VMS',
12 epoc => 'Epoc');
14 my $module = $module{$^O} || 'Unix';
15 require "File/Spec/$module.pm";
16 @ISA = ("File::Spec::$module");
19 __END__
21 =head1 NAME
23 File::Spec - portably perform operations on file names
25 =head1 SYNOPSIS
27 use File::Spec;
29 $x=File::Spec->catfile('a', 'b', 'c');
31 which returns 'a/b/c' under Unix. Or:
33 use File::Spec::Functions;
35 $x = catfile('a', 'b', 'c');
37 =head1 DESCRIPTION
39 This module is designed to support operations commonly performed on file
40 specifications (usually called "file names", but not to be confused with the
41 contents of a file, or Perl's file handles), such as concatenating several
42 directory and file names into a single path, or determining whether a path
43 is rooted. It is based on code directly taken from MakeMaker 5.17, code
44 written by Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya
45 Zakharevich, Paul Schinder, and others.
47 Since these functions are different for most operating systems, each set of
48 OS specific routines is available in a separate module, including:
50 File::Spec::Unix
51 File::Spec::Mac
52 File::Spec::OS2
53 File::Spec::Win32
54 File::Spec::VMS
56 The module appropriate for the current OS is automatically loaded by
57 File::Spec. Since some modules (like VMS) make use of facilities available
58 only under that OS, it may not be possible to load all modules under all
59 operating systems.
61 Since File::Spec is object oriented, subroutines should not called directly,
62 as in:
64 File::Spec::catfile('a','b');
66 but rather as class methods:
68 File::Spec->catfile('a','b');
70 For simple uses, L<File::Spec::Functions> provides convenient functional
71 forms of these methods.
73 For a list of available methods, please consult L<File::Spec::Unix>,
74 which contains the entire set, and which is inherited by the modules for
75 other platforms. For further information, please see L<File::Spec::Mac>,
76 L<File::Spec::OS2>, L<File::Spec::Win32>, or L<File::Spec::VMS>.
78 =head1 SEE ALSO
80 File::Spec::Unix, File::Spec::Mac, File::Spec::OS2, File::Spec::Win32,
81 File::Spec::VMS, File::Spec::Functions, ExtUtils::MakeMaker
83 =head1 AUTHORS
85 Kenneth Albanowski <F<kjahds@kjahds.com>>, Andy Dougherty
86 <F<doughera@lafcol.lafayette.edu>>, Andreas KE<ouml>nig
87 <F<A.Koenig@franz.ww.TU-Berlin.DE>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>. VMS
88 support by Charles Bailey <F<bailey@newman.upenn.edu>>. OS/2 support by
89 Ilya Zakharevich <F<ilya@math.ohio-state.edu>>. Mac support by Paul Schinder
90 <F<schinder@pobox.com>>. abs2rel() and rel2abs() written by
91 Shigio Yamaguchi <F<shigio@tamacom.com>>, modified by Barrie Slaymaker
92 <F<barries@slaysys.com>>. splitpath(), splitdir(), catpath() and catdir()
93 by Barrie Slaymaker.