line |
true |
false |
branch |
23
|
0 |
23 |
if @_
|
26
|
2 |
21 |
unless defined $what
|
29
|
0 |
21 |
if ref $opt ne 'HASH'
|
33
|
2 |
15 |
if none sub {
$key eq $_;
}
, 'atomic', 'LOCK_SH', 'LOCK_EX', 'LOCK_NB'
|
39
|
3 |
16 |
if ($type eq 'string')
|
40
|
15 |
1 |
if ($type eq 'file')
|
41
|
2 |
13 |
$$opt{'atomic'} ? :
|
42
|
0 |
15 |
unless $fh->open($proper_what, $how)
|
46
|
8 |
7 |
if ($$opt{'LOCK_SH'} or $$opt{'LOCK_EX'})
|
47
|
3 |
5 |
$$opt{'LOCK_SH'} ? :
|
|
5 |
3 |
$$opt{'LOCK_EX'} ? :
|
|
5 |
3 |
$$opt{'LOCK_NB'} ? :
|
|
4 |
4 |
unless flock $fh, ($$opt{'LOCK_SH'} ? 1 : 0) | ($$opt{'LOCK_EX'} ? 2 : 0) | ($$opt{'LOCK_NB'} ? 4 : 0)
|
56
|
1 |
0 |
if ($type eq 'iofile')
|
57
|
0 |
0 |
if ($type eq 'iostring')
|
58
|
0 |
0 |
if ($type eq 'http')
|
65
|
30 |
1 |
if (not blessed $what) { }
|
|
0 |
1 |
elsif ($what->isa('Path::Class::File')) { }
|
|
1 |
0 |
elsif (any sub {
$what->isa($_);
}
, 'IO::File', 'IO::AtomicFile', 'IO::Uncompress::Bunzip2') { }
|
|
0 |
0 |
elsif ($what->isa('IO::String')) { }
|
68
|
0 |
1 |
unless $what->opened
|
76
|
16 |
14 |
if ($ref_what eq 'ARRAY') { }
|
|
1 |
13 |
elsif ($ref_what eq 'SCALAR') { }
|
|
13 |
0 |
elsif ($ref_what eq '') { }
|
82
|
1 |
12 |
if (ref \$what eq 'GLOB' and my $fh = *{$what;}{'IO'})
|
86
|
1 |
11 |
if ($what =~ m[^file://(.+)$])
|
87
|
2 |
9 |
if ($what =~ m[^https?://])
|
88
|
1 |
8 |
if ($what =~ /^</)
|
89
|
2 |
6 |
if ($what =~ /^{/)
|
90
|
1 |
5 |
if ($what =~ /^\[/)
|
91
|
1 |
4 |
if ($what =~ /\n[\s\w]/)
|
92
|
2 |
2 |
if ($what eq '')
|
100
|
0 |
10 |
if @_
|
110
|
0 |
2 |
if @_
|
120
|
0 |
4 |
if @_
|
127
|
0 |
0 |
if ($INC{'AnyEvent.pm'} and not $fh->isa('IO::String') and $^O ne 'MSWin32')
|
128
|
0 |
0 |
unless $INC{'AnyEvent/Handle.pm'}
|
163
|
0 |
5 |
if @_
|
172
|
0 |
4 |
if ($INC{'AnyEvent.pm'} and not $fh->isa('IO::String'))
|
173
|
0 |
0 |
unless $INC{'AnyEvent/Handle.pm'}
|
198
|
0 |
4 |
unless $fh->close
|