Go to the documentation of this file.00001 package MMAgic::Log::Indent;
00002 #
00003 # MMAgic/Log/Indent.pm
00004 #
00005 # Object indents specified Log when created,
00006 # then removes indent when it is destroyed.
00007 # When assigned to a lexical ('my') variable
00008 # it should be destroyed when the variable
00009 # goes out of scope. We hope.
00010 #
00011
00012 # use warnings;
00013
00014 ###########################################################################
00015 ###########################################################################
00016 sub new # $class, $log [, $incr ]
00017 #
00018 {
00019 my $self = bless { target => $_[1] }, $_[0];
00020
00021 $self->{target}->push($_[2]);
00022 $self
00023 }
00024
00025 ###########################################################################
00026 sub DESTROY # $self
00027 #
00028 {
00029 $_[0]->{target}->pop;
00030 }
00031
00032 1