Advanced-Config
view release on metacpan or search on metacpan
lib/Advanced/Config/Date.pm view on Meta::CPAN
# How many days per month ... (non-leap year)
# ---------------------> J F M A M J J A S O N D
my @days_in_months = ( 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
# Updated by: init_special_date_arrays() ...
# May be for a different language than the above hashes ...
my $prev_array_lang = "English";
my @gMoY = qw ( January February March April May June
July August September October November December );
my @gMoYs = map { uc (substr($_,0,3)) } @gMoY;
my @gDsuf = sort { my ($x,$y) = ($a,$b); $x=~s/\D+$//; $y=~s/\D+$//; $x<=>$y } grep (/^\d+\D+$/, keys %Days, "0th");
my @gDoW = qw( Sunday Monday Tuesday Wednesday Thursday Friday Saturday );
my @gDoWs = map { uc (substr($_,0,3)) } @gDoW;
# ==============================================================
# Not in pod on purpose. Only added to simplify test cases.
sub _date_language_installed
{
return ( scalar (keys %date_language_installed_languages) );
}
# ==============================================================
lib/Advanced/Config/Date.pm view on Meta::CPAN
# ---------------------------------------------------------
foreach my $k ( keys %last_language_edit_flags ) {
$last_language_edit_flags{$k} = $issue1_ref->{$k} || $issue2_ref->{$k} || 0;
}
$last_language_edit_flags{language} = $lang;
# ---------------------------------------------------------
# Bug Alert: For some languges the following isn't true!
# lc(MoY) != lc(uc(lc(MoY)))
# So we have multiple lower case letters mapping to the
# same upper case letters#.
# ---------------------------------------------------------
# This happens for 3 languages for Date::Language.
# Chinese_GB, Greek & Russian_cp1251
# And one language for Date::Manip
# Turkish
# ---------------------------------------------------------
my %empty;
%Months = %Days = %empty;
lib/Advanced/Config/Date.pm view on Meta::CPAN
($MoY_ref, $MoYs_ref, $Dsuf_ref, $DoW_ref, $DoWs_ref) =
_swap_lang_common ( $lang_ref, $warn_ok, $allow_wide );
$lang = $lang_ref->{Language};
}
# If the new language was valid, update the global variables ...
if ( $MoY_ref ) {
$prev_array_lang = $lang;
@gMoY = @{$MoY_ref};
@gMoYs = map { uc($_) } @{$MoYs_ref};
@gDoW = @{$DoW_ref};
@gDoWs = map { uc($_) } @{$DoWs_ref};
@gDsuf = @{$Dsuf_ref};
DBUG_PRINT ( "LANGUAGE", "%s\n%s\n%s\n%s\n%s",
join (", ", @gMoY), join (", ", @gMoYs),
join (", ", @gDoW), join (", ", @gDoWs),
join (", ", @gDsuf)
);
}
# Numeric handled earlier ...
lib/Advanced/Config/Reader.pm view on Meta::CPAN
DBUG_MASK (0);
my $phrase;
unless ( $target =~ m/[^\x00-\xff]/ ) {
# Normal text ... (ascii)
$phrase = $target . pack ("C*", reverse (unpack ("C*", $target)));
} else {
# Unicode strings (utf8 / Wide Chars)
# Strip off the upper byte from each unicode char ...
my @ans = map { $_ % 0x100 } unpack ("U*", $target);
$phrase = pack ("C*", @ans) . pack ("C*", reverse (@ans));
}
my $key = $phrase;
while ( length ( $key ) < $len ) {
$key .= $phrase;
}
$key = substr ( $key, 0, $len ); # Truncate it to fit ...
t/config/30-alt_symbol_control.cfg view on Meta::CPAN
# So if you only have one section to compare, use "section_test_01".
# If you have multiple sections to compare use "section_test_01",
# "section_test_02", etc.
#
# So say section_test_01 = "abc", then it looks up tag "abc" in the
# referenced config file for the name of the section to use. Done like
# this since part of the tests were to use long messy section names
# and this avoided tests failing due to typos.
#
# Please note that sections of the same name are merged together and
# I want to be able to validate that muliple sections map correctly.
#
# ==========================================================================
#
# NOTE: The template file does not use sections! So when compared to a
# config file with sections, it only compares the current section in
# the target config file. All other sections will be ignored.
#
# If you don't use one of the special tags, it will only compare against
# the default main section.
#
( run in 1.534 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )