@@ -2,11 +2,10 @@ package Time::Local;
2
2
3
3
use strict;
4
4
5
- use Carp;
6
- use Config;
5
+ use Carp ();
7
6
use Exporter;
8
7
9
- our $VERSION = ' 1.24 ' ;
8
+ our $VERSION = ' 1.25 ' ;
10
9
11
10
use parent ' Exporter' ;
12
11
@@ -31,14 +30,20 @@ use constant SECS_PER_DAY => 86400;
31
30
32
31
my $MaxDay ;
33
32
if ( $] < 5.012000 ) {
33
+ require Config;
34
+ # # no critic (Variables::ProhibitPackageVars)
35
+
34
36
my $MaxInt ;
35
37
if ( $^O eq ' MacOS' ) {
36
38
37
39
# time_t is unsigned...
38
- $MaxInt = ( 1 << ( 8 * $Config {ivsize } ) ) - 1;
40
+ $MaxInt = ( 1 << ( 8 * $Config::Config {ivsize } ) )
41
+ - 1; # # no critic qw(ProhibitPackageVars)
39
42
}
40
43
else {
41
- $MaxInt = ( ( 1 << ( 8 * $Config {ivsize } - 2 ) ) - 1 ) * 2 + 1;
44
+ $MaxInt
45
+ = ( ( 1 << ( 8 * $Config::Config {ivsize } - 2 ) ) - 1 ) * 2
46
+ + 1; # # no critic qw(ProhibitPackageVars)
42
47
}
43
48
44
49
$MaxDay = int ( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1;
@@ -83,8 +88,7 @@ sub _daygm {
83
88
+ int ( $year / 4 )
84
89
- int ( $year / 100 )
85
90
+ int ( $year / 400 )
86
- + int ( ( ( $month * 306 ) + 5 ) / 10 ) )
87
- - $Epoc ;
91
+ + int ( ( ( $month * 306 ) + 5 ) / 10 ) ) - $Epoc ;
88
92
}
89
93
);
90
94
}
@@ -109,18 +113,22 @@ sub timegm {
109
113
}
110
114
111
115
unless ( $Options {no_range_check } ) {
112
- croak " Month '$month ' out of range 0..11"
116
+ Carp:: croak( " Month '$month ' out of range 0..11" )
113
117
if $month > 11
114
118
or $month < 0;
115
119
116
120
my $md = $MonthDays [$month ];
117
121
++$md
118
122
if $month == 1 && _is_leap_year( $year + 1900 );
119
123
120
- croak " Day '$mday ' out of range 1..$md " if $mday > $md or $mday < 1;
121
- croak " Hour '$hour ' out of range 0..23" if $hour > 23 or $hour < 0;
122
- croak " Minute '$min ' out of range 0..59" if $min > 59 or $min < 0;
123
- croak " Second '$sec ' out of range 0..59" if $sec >= 60 or $sec < 0;
124
+ Carp::croak(" Day '$mday ' out of range 1..$md " )
125
+ if $mday > $md or $mday < 1;
126
+ Carp::croak(" Hour '$hour ' out of range 0..23" )
127
+ if $hour > 23 or $hour < 0;
128
+ Carp::croak(" Minute '$min ' out of range 0..59" )
129
+ if $min > 59 or $min < 0;
130
+ Carp::croak(" Second '$sec ' out of range 0..59" )
131
+ if $sec >= 60 or $sec < 0;
124
132
}
125
133
126
134
my $days = _daygm( undef , undef , undef , $mday , $month , $year );
@@ -133,7 +141,7 @@ sub timegm {
133
141
$msg
134
142
.= " Cannot handle date ($sec , $min , $hour , $mday , $month , $year )" ;
135
143
136
- croak $msg ;
144
+ Carp:: croak( $msg ) ;
137
145
}
138
146
139
147
return
@@ -214,7 +222,7 @@ Time::Local - Efficiently compute time from local and GMT time
214
222
215
223
=head1 VERSION
216
224
217
- version 1.24
225
+ version 1.25
218
226
219
227
=head1 SYNOPSIS
220
228
@@ -370,24 +378,37 @@ The current version was written by Graham Barr.
370
378
371
379
The whole scheme for interpreting two-digit years can be considered a bug.
372
380
373
- Bugs may be submitted through L<the RT bug tracker|http://rt.cpan.org/Public/Dist/Display.html?Name=Time-Local>
374
-
381
+ Bugs may be submitted through L<https://github.com/houseabsolute/Time-Local/issues> .
375
382
376
383
There is a mailing list available for users of this distribution,
377
384
378
385
379
- I am also usually active on IRC as 'drolsky ' on C<irc://irc.perl.org > .
386
+ I am also usually active on IRC as 'autarch ' on C<irc://irc.perl.org > .
380
387
381
388
=head1 AUTHOR
382
389
383
390
384
391
385
- =head1 CONTRIBUTOR
392
+ =head1 CONTRIBUTORS
393
+
394
+ =for stopwords Florian Ragwitz J. Nick Koston Unknown
386
395
387
- =for stopwords Florian Ragwitz
396
+ =over 4
397
+
398
+ =item *
388
399
389
400
Florian Ragwitz <[email protected] >
390
401
402
+ =item *
403
+
404
+ J. Nick Koston <[email protected] >
405
+
406
+ =item *
407
+
408
+
409
+
410
+ =back
411
+
391
412
=head1 COPYRIGHT AND LICENSE
392
413
393
414
This software is copyright (c) 1997 - 2016 by Graham Barr & Dave Rolsky.
0 commit comments