Subject: | default_link_dict broken in 2.51 |
Date: | Fri, 22 Aug 2008 15:12:28 -0500 |
To: | bug-txt2html [...] rt.cpan.org |
From: | Dave Wolfe <Dave [...] WolfeWorks.net> |
Distribution: txt2html-2.51
Perl: v5.8.8 built for x86_64-linux-gnu-thread-multi
Ubuntu Linux: Linux version 2.6.24-19-generic (buildd@king) (gcc version
4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Fri Jul 11 21:01:46 UTC 2008
Specifying my own link dictionary works in 2.46 but not in 2.51. This is
due to changes in 2.51 (2.50?) which removed the deprecated reference-
to-an-array usage in the args method. Method do_init_call still uses the
removed feature and, as a result, attempts to set default_link_dict
becomes a nop (see line 5294 in TextToHTML.pm):
5294 $self->args(['--links_dictionaries', $ld]);
Ideally, the initial code in the args method would check for an odd
number of arguments before assigning the arguments to a hash and at
least warn the user that something is wrong, e.g.:
sub args
{
my $self = shift;
+ if (@_ % 2) {
+ my ($pkg, $fn, $line) = caller;
+ die "Method 'args' called with odd number of arguments by " .
+ "$pkg::$fn at line $line\n";
+ }
my %args = @_;
--
Dave Wolfe