This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix subtle bug in eval'' testsuite
[perl5.git] / lib / File / Spec.pm
CommitLineData
270d1e39
GS
1package File::Spec;
2
270d1e39 3use strict;
cbc7acb0 4use vars qw(@ISA $VERSION);
270d1e39
GS
5
6$VERSION = '0.6';
7
cbc7acb0
JD
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
GS
16
171;
18__END__
19
20=head1 NAME
21
22File::Spec - portably perform operations on file names
23
24=head1 SYNOPSIS
25
26C<use File::Spec;>
27
28C<$x=File::Spec-E<gt>catfile('a','b','c');>
29
30which returns 'a/b/c' under Unix.
31
32=head1 DESCRIPTION
33
34This module is designed to support operations commonly performed on file
35specifications (usually called "file names", but not to be confused with the
36contents of a file, or Perl's file handles), such as concatenating several
37directory and file names into a single path, or determining whether a path
38is rooted. It is based on code directly taken from MakeMaker 5.17, code
39written by Andreas KE<ouml>nig, Andy Dougherty, Charles Bailey, Ilya
40Zakharevich, Paul Schinder, and others.
41
42Since these functions are different for most operating systems, each set of
43OS specific routines is available in a separate module, including:
44
45 File::Spec::Unix
46 File::Spec::Mac
47 File::Spec::OS2
48 File::Spec::Win32
49 File::Spec::VMS
50
51The module appropriate for the current OS is automatically loaded by
52File::Spec. Since some modules (like VMS) make use of OS specific
53facilities, it may not be possible to load all modules under all operating
54systems.
55
56Since File::Spec is object oriented, subroutines should not called directly,
57as in:
58
59 File::Spec::catfile('a','b');
60
61but rather as class methods:
62
63 File::Spec->catfile('a','b');
64
8dcee03e 65For a reference of available functions, please consult L<File::Spec::Unix>,
270d1e39
GS
66which contains the entire set, and inherited by the modules for other
67platforms. For further information, please see L<File::Spec::Mac>,
68L<File::Spec::OS2>, L<File::Spec::Win32>, or L<File::Spec::VMS>.
69
70=head1 SEE ALSO
71
72File::Spec::Unix, File::Spec::Mac, File::Spec::OS2, File::Spec::Win32,
73File::Spec::VMS, ExtUtils::MakeMaker
74
75=head1 AUTHORS
76
77Kenneth Albanowski <F<kjahds@kjahds.com>>, Andy Dougherty
78<F<doughera@lafcol.lafayette.edu>>, Andreas KE<ouml>nig
79<F<A.Koenig@franz.ww.TU-Berlin.DE>>, Tim Bunce <F<Tim.Bunce@ig.co.uk>>. VMS
bd3fa61c 80support by Charles Bailey <F<bailey@newman.upenn.edu>>. OS/2 support by
270d1e39
GS
81Ilya Zakharevich <F<ilya@math.ohio-state.edu>>. Mac support by Paul Schinder
82<F<schinder@pobox.com>>.