X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=quotesite.git;a=blobdiff_plain;f=quotesite%2FBase.pm;h=08897c9a86cdd006eb651483d0560890c21d8065;hp=f0fa43945d03e5a1e11a149e16d634a2f349cb66;hb=20af9b1c4f051c0830ba35b8d3d15439c499e119;hpb=efd2a46770962a8ecf55e18c819b7c52042456d4 diff --git a/quotesite/Base.pm b/quotesite/Base.pm index f0fa439..08897c9 100644 --- a/quotesite/Base.pm +++ b/quotesite/Base.pm @@ -8,7 +8,7 @@ use Data::Dumper; sub new { my $class = shift; - my $self = {'_DEBUG' => 0, '_OUT' => sub {print shift}}; + my $self = {'_DEBUG' => 0, '_OUT' => sub {print shift}, '_OUTSTACK' => []}; bless($self, $class); @@ -91,6 +91,23 @@ sub setio { $self->{'_OUT'} = $io; } +sub pushio { + my $self = shift; + my $io = shift; + + push(@{$self->{'_OUTSTACK'}}, $self->{'_OUT'}); + $self->setio($io); +} + +sub popio { + my $self = shift; + my $io = pop(@{$self->{'_OUTSTACK'}}); + + if (defined($io)) { + $self->setio($io); + } +} + sub getconfstr { my $self = shift; my $s = 'Options for ' . $self->{'NAME'} . ":\n";