4 ms·
Yes, when you compare numbers lexically, "cmp" will say that 2 sorts after 10, and "<=>" will say it sorts before: perl -e 'printf "%d %d\n", 2 <=> 10, 2 cmp
by bewuethr 5y ago
Yes, when you compare numbers lexically, "cmp" will say that 2 sorts after 10, and "<=>" will say it sorts before:
perl -e 'printf "%d %d\n", 2 <=> 10, 2 cmp 10'
prints
-1 1