Integrate #13154 from macperl; Remove comments.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / OS2.pm
CommitLineData
270d1e39 1package File::Spec::OS2;
2
270d1e39 3use strict;
b4296952 4use vars qw(@ISA $VERSION);
cbc7acb0 5require File::Spec::Unix;
b4296952 6
7$VERSION = '1.1';
8
270d1e39 9@ISA = qw(File::Spec::Unix);
10
cbc7acb0 11sub devnull {
12 return "/dev/nul";
13}
270d1e39 14
46726cbe 15sub case_tolerant {
16 return 1;
17}
18
270d1e39 19sub file_name_is_absolute {
cbc7acb0 20 my ($self,$file) = @_;
1b1e14d3 21 return scalar($file =~ m{^([a-z]:)?[\\/]}is);
270d1e39 22}
23
24sub path {
270d1e39 25 my $path = $ENV{PATH};
26 $path =~ s:\\:/:g;
cbc7acb0 27 my @path = split(';',$path);
28 foreach (@path) { $_ = '.' if $_ eq '' }
29 return @path;
270d1e39 30}
31
cbc7acb0 32my $tmpdir;
33sub tmpdir {
34 return $tmpdir if defined $tmpdir;
35 my $self = shift;
a384e9e1 36 my @dirlist = ( @ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /) );
37 {
38 no strict 'refs';
39 if (${"\cTAINT"}) { # Check for taint mode on perl >= 5.8.0
40 require Scalar::Util;
41 @dirlist = grep { ! Scalar::Util::tainted $_ } @dirlist;
42 }
43 }
44 foreach (@dirlist) {
cbc7acb0 45 next unless defined && -d;
46 $tmpdir = $_;
47 last;
48 }
49 $tmpdir = '' unless defined $tmpdir;
50 $tmpdir =~ s:\\:/:g;
51 $tmpdir = $self->canonpath($tmpdir);
52 return $tmpdir;
99804bbb 53}
54
270d1e39 551;
56__END__
57
58=head1 NAME
59
60File::Spec::OS2 - methods for OS/2 file specs
61
62=head1 SYNOPSIS
63
cbc7acb0 64 require File::Spec::OS2; # Done internally by File::Spec if needed
270d1e39 65
66=head1 DESCRIPTION
67
68See File::Spec::Unix for a documentation of the methods provided
69there. This package overrides the implementation of these methods, not
70the semantics.