in reply to Re: Sort Says "not numeric" then sorts numeric anyway?
in thread Sort Says "not numeric" then sorts numeric anyway?
Strict doesn't cause the warning.
If it really bothers you, you can shut the warning up by turning the warning off:
use strict; use warnings; my @x = qw( 1xxx 2xxx 300x 10xx ); @x = sort @x; print "default sort: @x\n"; no warnings 'numeric'; @x = sort {$a <=> $b} @x; print "numeric sort: @x\n";
|
|---|