Re: BUG: t/base/headers-auth.t assumes an ordering of hash keys

Gisle Aas (gisle@aas.no)
06 Oct 1998 12:26:18 +0200


Albert Dvornik <bert@genscan.com> writes:

> Gisle Aas <gisle@aas.no> writes:
> > Did the test really fail for you?  I would expect it to fail the same
> > way for everybody.
> 
> Yes, it failed [on Solaris 2.3 + gcc 2.4.5, and please don't ask why I
> live in the Stone Age =)].  My `perl -V' output is appended below, in
> case you're interested.
> 
> I did find the fact no one found it before pretty strange; I'm
> guessing that the ordering might have something to do with malloc
> memory pools or other such obscurities.  I haven't actually looked at
> the Perl source to check this or anything, though.

The internal hash function that perl use for strings have changed
between perl5.005_51 and perl5.005_52.

Regards,
Gisle


*html, 'IO::Scalar', \$html;
  $p = HTML::TokeParser->new(\*html) || die;

Another trick is to just let HTML::TokeParser open "/dev/null" and
then insert your own data in the stream manually:

   $html = qq(<title>Test</title> This is more <i>text</i> 
   and this is a <a href="http://www.perl.com">link</a>);

   use HTML::TokeParser;
   $p = HTML::TokeParser->new("/dev/null");
   $p->parse($html);

   use Data::Dumper;  $Data::Dumper::Terse++; $Data::Dumper::Indent=0;

   while (my $token = $p->get_token) {
       print Dumper($token), "\n";
   }

Regards,
Gisle