our
(
$VERSION
,
$AUTOLOAD
);
$VERSION
=
'1.08'
;
sub
__new
{
my
$class
=
shift
;
no
strict
'refs'
;
my
$obj
= {};
$obj
->{weekdays} = \%{
"${class}::data_weekdays"
};
$obj
->{weekdays_abbrev} = \%{
"${class}::data_weekdays_abbrev"
};
$obj
->{weekdays_all} = \@{
"${class}::data_weekdays_all"
};
$obj
->{months} = \%{
"${class}::data_months"
};
$obj
->{months_abbrev} = \%{
"${class}::data_months_abbrev"
};
$obj
->{months_all} = \@{
"${class}::data_months_all"
};
$obj
->{conversion} = \%{
"${class}::data_conversion"
};
$obj
->{helpers} = \%{
"${class}::data_helpers"
};
$obj
->{duration} = \%{
"${class}::data_duration"
};
$obj
->{aliases} = \%{
"${class}::data_aliases"
};
$obj
->{rewrite} = \%{
"${class}::data_rewrite"
};
return
bless
$obj
,
$class
;
}
AUTOLOAD
{
my
(
$self
,
$exp
) =
@_
;
my
(
$caller
,
$sub
) =
$AUTOLOAD
=~ /^(.+)::(.+)$/;
if
(
substr
(
$sub
, 0, 2) eq
'__'
) {
$sub
=~ s/^__//;
no
strict
'refs'
;
if
(
defined
$exp
&&
length
$exp
) {
return
${
$caller
.
'::'
.
$sub
}{
$exp
};
}
else
{
return
\%{
$caller
.
'::'
.
$sub
};
}
}
}
1;