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.12'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1209
|
use Moo; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
12
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
514
|
use Carp qw(croak); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
134
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::Handle); |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
1233
|
use IO::File; |
|
3
|
|
|
|
|
18407
|
|
|
3
|
|
|
|
|
295
|
|
13
|
3
|
|
|
3
|
|
12
|
use namespace::clean; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
13
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => ( |
16
|
|
|
|
|
|
|
is => "rw", |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub open_handle { |
21
|
3
|
|
|
3
|
1
|
4
|
my ( $self, $mode ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
22
|
my $file = $self->path; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
15
|
my $fh = IO::File->new; |
26
|
|
|
|
|
|
|
|
27
|
3
|
50
|
50
|
|
|
84
|
$fh->open($file, $mode || "r") |
28
|
|
|
|
|
|
|
or croak "open($file): $!"; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
184
|
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.12 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use Moo; |
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__ |