http://qs1969.pair.com?node_id=433567


in reply to AI::Genetic gives me strange warnings

Yeah, it appears to be a perl bug, as I've now gotten something that demonstrates this problem without using AI::Genetic:

#!/usr/bin/perl use strict; use warnings; package yo; use Data::Dumper; sub my_f { my $genes = shift; my @order = (0,1,2,3); my @sorted = sort { local $SIG{__WARN__} = sub {print Dumper($a,$b); print @_; sleep 1 +;}; $genes->[$a] <=> $genes->[$b] } @order; my $score = $sorted[1] + 2*$sorted[2] + 3*$sorted[3]; print "DEBUG: score was $score\n"; return $score; } package main; $|=1; my @populace = map { [ map {rand 100;} (1..4) ] } (1..100); my @spopu = sort {yo::my_f($a) <=> yo::my_f($b)} @populace;
Well, hell. This sucks - I wonder if this is a documented perl bug anywhere?
-- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/