Interesting findings! In the original sort_versions, what happens if you change sort { version_cmp($a,"<=>",$b) } @_; to sort version_cmp($a,"<=>",$b) @_; or sort { &version_cmp($a,"<=>",$b) } @_;
On Tue, Feb 22, 2005 at 09:12:30PM +0100, Martin Costabel wrote: > Martin Costabel wrote: > >Now that the fink versions on Jaguar and Panther are different, it would > >be nice if the old dumpinfo bug could be fixed. > > Whereas I don't know enough perl to understand the origin of the > problem, here is some observation that could perhaps help some of you > perl gurus to see what is going on: > > The point where the bug > >Failed: Sort subroutine didn't return single value at > >/sw/lib/perl5/Fink/Services.pm line 766. > > appears is the following subroutine: > > sub sort_versions { > sort { version_cmp($a,"<=>",$b) } @_; > } > > In perl-5.8.x this works as intended, in perl-5.6.x it produces the error. > > When I replace the subroutine by the following two subroutines which in > my (virtually non-existing) understanding of perl should be entirely > equivalent: > > sub my_version_cmp { > version_cmp($a,"<=>",$b) > } > > sub sort_versions { > sort my_version_cmp @_; > } > > then the error disappears. OTOH, when I replace here the line > sort my_version_cmp @_; > by > sort { my_version_cmp } @_; > then the error reappears. -- Daniel Macks [EMAIL PROTECTED] http://www.netspace.org/~dmacks ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Fink-devel mailing list Fink-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fink-devel