Add new File::Spec::VMS methods
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / Functions.pm
1 package File::Spec::Functions;
2
3 use File::Spec;
4 use strict;
5
6 use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
7
8 require Exporter;
9
10 @ISA = qw(Exporter);
11
12 @EXPORT = qw(
13         canonpath
14         catdir
15         catfile
16         curdir
17         rootdir
18         updir
19         no_upwards
20         file_name_is_absolute
21         path
22 );
23
24 @EXPORT_OK = qw(
25         devnull
26         tmpdir
27         splitpath
28         splitdir
29         catpath
30         abs2rel
31         rel2abs
32 );
33
34 %EXPORT_TAGS = ( ALL => [ @EXPORT_OK, @EXPORT ] );
35
36 foreach my $meth (@EXPORT, @EXPORT_OK) {
37     my $sub = File::Spec->can($meth);
38     no strict 'refs';
39     *{$meth} = sub {&$sub('File::Spec', @_)};
40 }
41
42
43 1;
44 __END__
45
46 =head1 NAME
47
48 File::Spec::Functions - portably perform operations on file names
49
50 =head1 SYNOPSIS
51
52         use File::Spec::Functions;
53         $x = catfile('a','b');
54
55 =head1 DESCRIPTION
56
57 This module exports convenience functions for all of the class methods
58 provided by File::Spec.
59
60 For a reference of available functions, please consult L<File::Spec::Unix>,
61 which contains the entire set, and which is inherited by the modules for
62 other platforms. For further information, please see L<File::Spec::Mac>,
63 L<File::Spec::OS2>, L<File::Spec::Win32>, or L<File::Spec::VMS>.
64
65 =head2 Exports
66
67 The following functions are exported by default.
68
69         canonpath
70         catdir
71         catfile
72         curdir
73         rootdir
74         updir
75         no_upwards
76         file_name_is_absolute
77         path
78
79
80 The following functions are exported only by request.
81
82         devnull
83         tmpdir
84         splitpath
85         splitdir
86         catpath
87         abs2rel
88         rel2abs
89
90 All the functions may be imported using the C<:ALL> tag.
91
92 =head1 SEE ALSO
93
94 File::Spec, File::Spec::Unix, File::Spec::Mac, File::Spec::OS2,
95 File::Spec::Win32, File::Spec::VMS, ExtUtils::MakeMaker