line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Buffered::Split; |
2
|
8
|
|
|
8
|
|
38
|
use strict; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
262
|
|
3
|
8
|
|
|
8
|
|
39
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
218
|
|
4
|
8
|
|
|
8
|
|
44
|
use Carp; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
483
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
47
|
use base ("IO::Buffered"); |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
1208
|
|
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
4636
|
use IO::Buffered::Regexp; |
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
482
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# FIXME: Write documentation |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
IO::Buffered::Split - Split based buffering |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=over |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
8
|
|
|
8
|
|
42
|
use base "Exporter"; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
1802
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item new() |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
5
|
|
|
5
|
1
|
12
|
my ($class, $regexp, %opts) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Check that $regexp is a Regexp or a non empty string |
40
|
5
|
50
|
66
|
|
|
877
|
croak "Split should be a string or regexp" if !(defined $regexp and |
|
|
|
66
|
|
|
|
|
41
|
|
|
|
|
|
|
(ref $regexp eq 'Regexp' or (ref $regexp eq '' and $regexp ne ''))); |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
25
|
return new IO::Buffered::Regexp(qr/(.*?)$regexp/, %opts, ReturnsLast => 0); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Troels Liebe Bentsen |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 COPYRIGHT |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Copyright(C) 2008 Troels Liebe Bentsen |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
57
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|