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