lib/KinoSearch1/Store/InStream.pm

filter: Statementstmt 95.7% 112 / 117 Branchbran 87.5% 28 / 32 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 93.9% 140 / 149 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/KinoSearch1/Search/Similarity.pm ↑ Summary lib/KinoSearch1/Util/SortExternal.pm »
1 package KinoSearch1::Store::InStream;
2 use base qw( KinoSearch1::Util::CClass );
3 use strict;
4 use warnings;
5 use KinoSearch1::Util::ToolSet;
6  
7 sub close { CORE::close shift->get_fh }
8  
9 =for comment
10 Dupe the filehandle and create a new object around the dupe. Seek the dupe
11 to the same spot as the original.
12  
13 =cut
14  
15 sub clone_stream {
16 my $self = shift;
17 open( my $duped_fh, '<&=', $self->get_fh )
18 or confess("Couldn't dupe filehandle: $!");
19 my $evil_twin
20 = __PACKAGE__->new( $duped_fh, $self->get_offset, $self->length, );
21 $evil_twin->seek( $self->tell );
22 return $evil_twin;
23 }
24  
25 1;
26  
27 __END__
« lib/KinoSearch1/Search/Similarity.pm ↑ Summary lib/KinoSearch1/Util/SortExternal.pm »