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

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