#!/usr/bin/perl -wT use strict; my @a = (5..15); print "cmp comparison of 9 and 10: ", 10 cmp 9, "\n"; print "<=> comparison of 9 and 10: ", 10 <=> 9, "\n"; print "\n"; print "cmp sort of 5..15: ", join(' ',(sort @a)), "\n"; print "<=> sort of 5..15: ", join(' ',(sort {$a<=>$b} @a)), "\n"; =output cmp comparison of 9 and 10: -1 <=> comparison of 9 and 10: 1 cmp sort of 5..15: 10 11 12 13 14 15 5 6 7 8 9 <=> sort of 5..15: 5 6 7 8 9 10 11 12 13 14 15