line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Slurp; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
84570
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
4
|
1
|
|
|
1
|
|
6
|
use vars qw/ @EXPORT @EXPORT_OK @ISA $VERSION /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
665
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
@ISA = qw/ Exporter /; |
7
|
|
|
|
|
|
|
@EXPORT = qw/ slurp /; |
8
|
|
|
|
|
|
|
@EXPORT_OK = qw/ slurp to_array to_scalar /; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.4'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub slurp { |
15
|
3
|
100
|
|
3
|
1
|
23
|
local( $/, @ARGV ) = ( wantarray ? $/ : undef, @_ ); |
16
|
3
|
|
|
|
|
188
|
return ; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub to_array { |
20
|
2
|
|
|
2
|
1
|
2174
|
my @array = slurp( @_ ); |
21
|
2
|
100
|
|
|
|
13
|
return wantarray ? @array : \@array; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub to_scalar { |
25
|
1
|
|
|
1
|
1
|
426
|
my $scalar = slurp( @_ ); |
26
|
1
|
|
|
|
|
7
|
return $scalar; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |