Hmmm. As suspected the failures result from a sort order problem. The interesting thing is that they occur in a seemingly random manner (on most systems they are in one order and OK but on other systems they are broken.) CGI::Simple uses the same method of retaining passed param order as CGI. Params are parsed in the order they are received and the param keys are pushed into an array to remember the order. Specifically this happens

push @{$self->{'.parameters'}}, $param;

@.parameters is used to remeber the supplied order. In the test scripts the problem arises thusly:

# new() hash constructor print "Testing: new() hash constructor\n" if $debug; $q = new CGI::Simple( { 'foo'=>'1', 'bar'=>[2,3,4] } ); @av = $q->param; ok( (join' ',@av), 'foo bar' ); #68

This is the code for the first test that fails. Evidently on certain versions of perl/OS the bucket architecture changes so that when the hash ref is passed in some cases this code:

elsif ( (ref $init) =~ m/HASH/i ) { # initialize from param hash for my $param( keys %{$init} ) { $self->_add_param( $param, $init->{$param} ); } }

returns the keys in a different order. As a result they are pushed into @.parameters in a different order and returned in a different order. Adding a reverse sort at this point will fix the tests BUT as this is exactly the same method CGI uses break concurrence.

Rather than break this concurrence I will modify the test to reflect the two possible return cases. For all intents and purposes it is unlikey to make any real world difference.

Thanks very much for your time

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Re: Need help with module problem specific to sun-solaris by tachyon
in thread Need help with module problem specific to sun-solaris by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.