On Fri, 23 Apr 2004, Tim Jenness wrote:
> On Fri, 23 Apr 2004, Peter W. Draper wrote:
>
> > This one turns out to be due to the following statement in latex2html:
> >
> > local $cnt = (split('/',%open))[0];
> >
> > which under Perl 5.8.2 returns different values than it did in 5.6.1, that
> > in turn leaves some mini table of contents incomplete (the footers
> > right-shift as a consequence of this). After a long look on the web I see
> > that this is supposed to return an array of 2 values, the number of used
> > and allocated buckets in the hash. Unfortunately for latex2html the number
> > of buckets isn't the same the number of values stored in the hash, but
> > apparently it used to be. I mention this as, one it took me a while to
> > work this out (Perl is back on my bad list today) and there are instances
> > littered throughout both versions of latex2html, so watch out, this
> > problem may bite elsewhere. I'll fix any that are reported.
>
> Good grief! latex2html has some really really bad code in it. Why on earth
> would they use a hash in scalar context to work out the number of keys -
> it's documented to return the hash efficiency which in turn depends
> critically on the hashing algorithm. Code that relied on a specific
> hashing algorithm is broken (as we can see since perl5.8.0 uses a much
> better algorithm generating fewer collisions. Replacing the whole
> expression with "scalar keys %open" will do the trick and since it's an
> easy grep the change should be made every where.
Welcome to the world of latex2html. I was tempted to just do as you
suggest, but a nasty thought occured to me, perhaps some of the code
relies on this misbehaviour, it's possible as so much is just tweaked to
get things working. So I decided to fix things as required and leave a
longer look for a rainy day. Do you know if the split invocation would, by
chance, always return the number of entries prior to 5.8.0, if so then it
would do no further harm.
> I'm assuming the latest latex2html does not have this problem.
Don't know, stopped tracking developments years ago, we were supposed to
be moving to a new documentation system, so this has been on minimal
maintenance for sometime.
Peter.
|