Subject: | Error formatting the output of PrintList method |
Name and version: Archive-Rar-1.92
Perl version: v5.8.5
OS: Linux 2.6.9-55.EL #1
Using the PrintList method to print the content of the archive without
exploding it, shows the following output:
Invalid conversion in printf: "%|" at Archive/Rar.pm line 391.
This is due to the formatting instruction at line 391 regarding the
visualization of the percentage symbol _%_:
you should change from:
printf $fh ("| %-40.40s | %8.8s | %8.8s | %3.3s%
|\n",$p->{name},$p->{size},$p->{packed},100-$p->{ratio});
to:
printf $fh ("| %-40.40s | %8.8s | %8.8s | %3.3s%%
|\n",$p->{name},$p->{size},$p->{packed},100-$p->{ratio});
(look at the double percentage symbol)
Example to reproduce the problem:
use Archive::Rar;
use strict;
my $rar = new Archive::Rar();
my $archive_filename = "myarchive.rar";
$rar->List( -archive => $archive_filename );
$rar->PrintList( );