in case you are wondering, $set->{"cards"} contains an array of cards objects that each have a value method, that returns the value of the card. So far so good. You'll notice the print statement calls the value() method for each card, just before the sort block does the same thing. So:sub sort_by_value { my $set = shift; print "start\n"; print join(',',map {$_->value} @{$set->{"cards"}}); print "end\n"; @{$set->{"cards"}} = sort {$a->value <=> $b->value} @{$set->{"cards" +}}; }
In reply to Vanishing bug by steer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |