package Date::Manip;
# Copyright (c) 1995-2007 Sullivan Beck. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
###########################################################################
###########################################################################
use vars qw($OS %Lang %Holiday %Events %Curr %Cnf %Zone $VERSION @ISA @EXPORT);
# Determine the type of OS...
$OS="Unix";
$OS="Windows" if ((defined $^O and
$^O =~ /MSWin32/i ||
$^O =~ /Windows_95/i ||
$^O =~ /Windows_NT/i) ||
(defined $ENV{OS} and
$ENV{OS} =~ /MSWin32/i ||
$ENV{OS} =~ /Windows_95/i ||
$ENV{OS} =~ /Windows_NT/i));
$OS="Unix" if (defined $^O and
$^O =~ /cygwin/i);
$OS="Netware" if (defined $^O and
$^O =~ /NetWare/i);
$OS="Mac" if ((defined $^O and
$^O =~ /MacOS/i) ||
(defined $ENV{OS} and
$ENV{OS} =~ /MacOS/i));
$OS="MPE" if (defined $^O and
$^O =~ /MPE/i);
$OS="OS2" if (defined $^O and
$^O =~ /os2/i);
$OS="VMS" if (defined $^O and
$^O =~ /VMS/i);
$OS="AIX" if (defined $^O and
$^O =~ /aix/i);
# Determine if we're doing taint checking
$Date::Manip::NoTaint = eval { local $^W=0; eval("#" . substr($^X, 0, 0)); 1 };
###########################################################################
# CUSTOMIZATION
###########################################################################
#
# See the section of the POD documentation section CUSTOMIZING DATE::MANIP
# below for a complete description of each of these variables.
# Location of a the global config file. Tilde (~) expansions are allowed.
# This should be set in Date_Init arguments.
$Cnf{"GlobalCnf"}="";
$Cnf{"IgnoreGlobalCnf"}="";
# Name of a personal config file and the path to search for it. Tilde (~)
# expansions are allowed. This should be set in Date_Init arguments or in
# the global config file.
@Date::Manip::DatePath=();
if ($OS eq "Windows") {
$Cnf{"PathSep"} = ";";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "Netware") {
$Cnf{"PathSep"} = ";";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "MPE") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "OS2") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "Mac") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "VMS") {
# VMS doesn't like files starting with "."
$Cnf{"PathSep"} = ",";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = "/sys\$login";
} else {
# Unix
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = ".DateManip.cnf";
$Cnf{"PersonalCnfPath"} = ".:~";
@Date::Manip::DatePath=qw(/bin /usr/bin /usr/local/bin);
}
### Date::Manip variables set in the global or personal config file
# Which language to use when parsing dates.
=1= |