WebSocket/Base/ReadString.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 24 CC 2 SCAR 12.0
CC
2
Cov
0%
_read
6.0
new
2.0
BEGIN
2.0
CRAP 3.3
1 package Net::WebSocket::Base::ReadString;
2  
3 use strict;
4 use warnings;
5  
6 use Net::WebSocket::X ();
7  
8 sub new {
9 my ($class, $str_sr) = @_;
10  
11 return bless { _sr => $str_sr }, $class;
12 }
13  
14 sub _read {
15 my ($self, $len) = @_;
16  
17 die "Useless zero read!" if $len == 0;
18  
19 return substr( ${ $self->{'_sr'} }, 0, $len, q<> );
20 }
21  
22 1;