9 $_output = _output->new(@_);
16 my $name = $output::AUTOLOAD;
17 $name =~ s/^.*::(.[^:]*)$/$1/;
19 return $_output->$name(@_);
26 my $stdout_isatty = -t STDOUT;
27 my $stderr_isatty = -t STDERR;
31 my $class = ref($proto) || $proto;
33 bless ($self, $class);
35 my $progress = \${$self->{PROGRESS}};
36 my $last_progress = \${$self->{LAST_PROGRESS}};
37 my $progress_count = \${$self->{PROGRESS_COUNT}};
38 my $prefix = \${$self->{PREFIX}};
51 my $progress = \${$self->{PROGRESS}};
52 my $last_progress = \${$self->{LAST_PROGRESS}};
53 my $progress_count = \${$self->{PROGRESS_COUNT}};
57 if($$progress_count > 0 && $$progress && $stderr_isatty) {
58 print STDERR $$progress;
59 $$last_progress = $$progress;
65 my $progress = \${$self->{PROGRESS}};
66 my $last_progress = \${$self->{LAST_PROGRESS}};
67 my $progress_count = \${$self->{PROGRESS_COUNT}};
71 if($$last_progress && $stderr_isatty) {
73 for (1..length($$last_progress)) {
76 print STDERR $message;
77 undef $$last_progress;
83 my $progress = \${$self->{PROGRESS}};
84 my $last_progress = \${$self->{LAST_PROGRESS}};
89 for (1..length($$last_progress)) {
93 my $diff = length($$last_progress)-length($$progress);
103 print STDERR $prefix . $$progress . $suffix;
104 $$last_progress = $$progress;
109 my $progress = \${$self->{PROGRESS}};
113 $self->update_progress;
118 my $prefix = \${$self->{PREFIX}};
128 my $prefix = \${$self->{PREFIX}};
130 $self->hide_progress if $stdout_isatty;
131 print $$prefix . $message;
132 $self->show_progress if $stdout_isatty;