line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Random::Source::Base::File; |
2
|
|
|
|
|
|
|
# ABSTRACT: File (or device) random data sources |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
2084
|
use Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
16
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
782
|
use Carp qw(croak); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
289
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::Handle); |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
2330
|
use IO::File; |
|
3
|
|
|
|
|
30339
|
|
|
3
|
|
|
|
|
530
|
|
13
|
3
|
|
|
3
|
|
19
|
use namespace::clean; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
24
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => ( |
16
|
|
|
|
|
|
|
is => "rw", |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub open_handle { |
21
|
3
|
|
|
3
|
1
|
8
|
my ( $self, $mode ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
38
|
my $file = $self->path; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
23
|
my $fh = IO::File->new; |
26
|
|
|
|
|
|
|
|
27
|
3
|
50
|
50
|
|
|
141
|
$fh->open($file, $mode || "r") |
28
|
|
|
|
|
|
|
or croak "open($file): $!"; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
254
|
return $fh; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=encoding UTF-8 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Crypt::Random::Source::Base::File - File (or device) random data sources |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 VERSION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
version 0.11 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use Moose; |
50
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::File); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
has '+path' => ( |
53
|
|
|
|
|
|
|
default => "/foo/bar", |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 DESCRIPTION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This is a base class for file (or file like) random data sources. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 path |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A required attribute, the path to the file to open. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 open_handle |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Uses L to open C for reading. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SUPPORT |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Bugs may be submitted through L |
75
|
|
|
|
|
|
|
(or L). |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Yuval Kogman. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
86
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |