line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dir::Manifest::Slurp; |
2
|
|
|
|
|
|
|
$Dir::Manifest::Slurp::VERSION = '0.4.0'; |
3
|
2
|
|
|
2
|
|
57495
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1032
|
use Socket qw(:crlf); |
|
2
|
|
|
|
|
6767
|
|
|
2
|
|
|
|
|
521
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
774
|
use parent qw(Exporter); |
|
2
|
|
|
|
|
530
|
|
|
2
|
|
|
|
|
12
|
|
9
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [qw( as_lf slurp )] ); |
10
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
11
|
|
|
|
|
|
|
our @EXPORT = qw(); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub as_lf |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
1
|
80
|
my ($s) = @_; |
16
|
2
|
|
|
|
|
24
|
$s =~ s#$CRLF#$LF#g; |
17
|
2
|
|
|
|
|
17
|
return $s; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub slurp |
21
|
|
|
|
|
|
|
{ |
22
|
15
|
|
|
15
|
1
|
17348
|
my ( $fh, $opts ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
15
|
50
|
|
|
|
38
|
if ( $opts->{raw} ) |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
0
|
return $fh->slurp_raw; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else |
29
|
|
|
|
|
|
|
{ |
30
|
15
|
|
|
|
|
39
|
my $ret = $fh->slurp_utf8; |
31
|
15
|
100
|
|
|
|
3166
|
return $opts->{lf} ? as_lf($ret) : $ret; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |