I see a line, "@sorted = sort {$a <=> $b} @array;"
The text book I read says, "When you need to sort data in
numerical order, you have to add an argument to the sort
statement.
What confuses me is '$a <=> $b'.
Could you explain what this line do? Can I use '$c <=> $d'
instead?
In reply to $a <=> $b by truthseeker66
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |