Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Argument isn't numeric in sort -- resolve or ignore?by GrandFather (Saint) |
on Feb 26, 2016 at 02:03 UTC ( [id://1156168]=note: print w/replies, xml ) | Need Help?? |
You can't ignore the warnings - they highlight an error in your code as suggested by davido. Sort expects a compare sub to return -1, 0 or 1 meaning $a sorts before $b, $a and $b sort equivalently, or $b sorts before $a. Other values do not make sense. Returning $a does not make sense (for any usual sort anyway). Describe in words what your sort criteria are and either the implementation will come clear to you, or we can help you achieve that. Smart match is probably not useful here. Quite likely you can use grep instead.
Premature optimization is the root of all job security
In Section
Seekers of Perl Wisdom
|
|