print scalar <DATA>;
It has one newline because I didn't chomp it. And the second, because I have -l on the hashbang line:
#! perl -slw
Which has the affect of automatically adding "\n" to the end of every print line.
The +1 in this line: print join "\t", $label, map $_+1, sort{
$order[ $a ] <=> $order[ $b ]
} 0 .. $#order;
converts the numbers 0 .. 3 used to index the array while sorting. into the numbers 1 .. 4 used for your desired output.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|