line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Time::Random; |
2
|
3
|
|
|
3
|
|
195794
|
use 5.006; use strict; use warnings; our $VERSION = '1.00'; |
|
3
|
|
|
3
|
|
27
|
|
|
3
|
|
|
3
|
|
15
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
69
|
|
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
161
|
|
3
|
3
|
|
|
3
|
|
1729
|
use Time::Piece; |
|
3
|
|
|
|
|
36207
|
|
|
3
|
|
|
|
|
14
|
|
4
|
3
|
|
|
3
|
|
250
|
use base 'Import::Export'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1568
|
|
5
|
|
|
|
|
|
|
our %EX = ( |
6
|
|
|
|
|
|
|
time_random => [qw/all/], |
7
|
|
|
|
|
|
|
); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub time_random { |
10
|
106
|
100
|
|
106
|
1
|
49208
|
my %args = scalar @_ == 1 ? %{ $_[0] } : @_; |
|
2
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
$args{$_} = $args{$_} |
12
|
|
|
|
|
|
|
? $args{strptime} |
13
|
|
|
|
|
|
|
? Time::Piece->strptime($args{$_}, $args{strptime})->epoch |
14
|
|
|
|
|
|
|
: ref $args{$_} |
15
|
|
|
|
|
|
|
? $args{$_}->epoch() |
16
|
|
|
|
|
|
|
: $args{$_} |
17
|
|
|
|
|
|
|
: $_ eq 'to' ? time : ($args{to} - int(rand(86400))) |
18
|
106
|
100
|
|
|
|
551
|
foreach qw/to from/; |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
19
|
106
|
|
|
|
|
705
|
$args{time} = gmtime($args{to} - int(rand($args{to} - $args{from}))); |
20
|
106
|
100
|
|
|
|
5109
|
$args{strftime} ? $args{time}->strftime($args{strftime}) : $args{time}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |