line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Array::Sample::SimpleRandom::Scan; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
53523
|
use 5.010001; |
|
1
|
|
|
|
|
10
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Exporter qw(import); |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
126
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
10
|
|
|
|
|
|
|
our $DATE = '2022-05-21'; # DATE |
11
|
|
|
|
|
|
|
our $DIST = 'Array-Sample-SimpleRandom'; # DIST |
12
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw(sample_simple_random_no_replacement); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub sample_simple_random_no_replacement { |
17
|
5
|
|
|
5
|
1
|
3237
|
require Array::Pick::Scan; |
18
|
|
|
|
|
|
|
|
19
|
5
|
|
|
|
|
509
|
my ($ary, $n, $opts) = @_; |
20
|
5
|
|
|
|
|
13
|
Array::Pick::Scan::random_item($ary, $n, $opts); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
# ABSTRACT: Simple random sampling from an array (scan algorithm) |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |