Le Jeu 27 Mai 2010 09:36:10, KEICHNER a écrit :
Show quoted text> Le Jeu 27 Mai 2010 08:34:31, AVAR a écrit :
> > A gripe with Term::Sk's output. The output is formatted like this:
> >
> > format: '%d Elapsed: %8t %21b %4p %2d (%8c of %11m)'
> > output: Elapsed: 00:00:00 ########_____________ 40% \\ ( 1_971
> > of
> > 4_943)
> >
> > It would be really nice if %c and %m supported dynamic growth. Now
> > they
> > just occupy exactly one character, and will wrap when their values go
> > past 9.
>
> Thanks for your message.
> I will fix the wrapping by allowing dynamic growth.
>
> I think I will find some time next week to change the module.
>
> --
> Klaus
I have released Term::Sk ver 0.06
Here is a showcase:
use strict;
use warnings;
use Term::Sk;
{
print qq|Term::Sk->new('num %c of %m', { test => 1, base => 1234567,
target => 2345678, num => q{9,999} } );\n|;
my $ctr = Term::Sk->new('num %c of %m', { test => 1, base =>
1234567, target => 2345678, num => q{9,999} } );
print "Result: ", content($ctr->get_line), "\n\n";
}
sub content {
my ($text) = @_;
$text =~ s{^ \010+ \s+ \010+}{}xms;
return $text;
}
*****************************************************
And this is the output:
*****************************************************
Term::Sk->new('num %c of %m', { test => 1, base => 1234567, target =>
2345678, num => q{9,999} } );
Result: num 1,234,567 of 2,345,678
*****************************************************
If you agree, I will close this ticket.
--
Klaus