| 1 | package Dir::Manifest::Slurp; | ||||||||||
| 2 | 4 | $Dir::Manifest::Slurp::VERSION = '0.4.0'; | |||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use Socket qw(:crlf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use parent qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | our %EXPORT_TAGS = ( 'all' => [qw( as_lf slurp )] ); | |||||||||
| 10 | 4 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||
| 11 | 4 | our @EXPORT = qw(); | |||||||||
| 12 | |||||||||||
| 13 | sub as_lf | ||||||||||
| 14 | { | ||||||||||
| 15 | 2 | ▶ | my ($s) = @_; | ||||||||
|
Subroutine
as_lf: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 16 | 2 | $s =~ s#$CRLF#$LF#g; | |||||||||
| 17 | 2 | return $s; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | sub slurp | ||||||||||
| 21 | { | ||||||||||
| 22 | 15 | ▶ | my ( $fh, $opts ) = @_; | ||||||||
|
Subroutine
slurp: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | 15 | ▶ | if ( $opts->{raw} ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | { | ||||||||||
| 26 | 0 | return $fh->slurp_raw; | |||||||||
| 27 | } | ||||||||||
| 28 | else | ||||||||||
| 29 | { | ||||||||||
| 30 | 15 | my $ret = $fh->slurp_utf8; | |||||||||
| 31 | 15 | ▶ | return $opts->{lf} ? as_lf($ret) : $ret; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 4 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||