IO-TieCombine

 view release on metacpan or  search on metacpan

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

#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


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


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.470 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )