IO-TieCombine

 view release on metacpan or  search on metacpan

lib/IO/TieCombine.pm  view on Meta::CPAN

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pod =cut
 
sub new {
  my ($class) = @_;
 
  my $self = {
    combined => \(my $str = ''),
    slots    => { },
  };
 
  bless $self => $class;
}
 
#pod =method combined_contents
#pod
#pod This method returns the contents of all collected data.
#pod
#pod =cut
 
sub combined_contents {
  my ($self) = @_;

lib/IO/TieCombine/Handle.pm  view on Meta::CPAN

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sub TIEHANDLE {
  my ($class, $arg) = @_;
 
  my $self = {
    slot_name    => $arg->{slot_name},
    combined_ref => $arg->{combined_ref},
    output_ref   => $arg->{output_ref},
  };
 
  return bless $self => $class;
}
 
sub PRINT {
  my ($self, @output) = @_;
 
  my $joined = join((defined $, ? $, : q{}), @output)
             . (defined $\ ? $\ : q{});
 
  ${ $self->{output_ref}   } .= $joined;
  ${ $self->{combined_ref} } .= $joined;

lib/IO/TieCombine/Scalar.pm  view on Meta::CPAN

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sub TIESCALAR {
  my ($class, $arg) = @_;
 
  my $self = {
    slot_name    => $arg->{slot_name},
    combined_ref => $arg->{combined_ref},
    output_ref   => $arg->{output_ref},
  };
 
  bless $self => $class;
}
 
sub FETCH {
  return ${ $_[0]->{output_ref} }
}
 
sub STORE {
  my ($self, $value) = @_;
  my $class = ref $self;
  my $output_ref = $self->{output_ref};

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.943 second using v1.00-cache-2.02-grep-82fe00e-cpan-6a81d49e493 )