> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 24, 2002 5:31 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: another sort question (flame away) > > > This should not matter what the size is but would > expect a number at > the beginning: > > foreach my $MyKey (sort {$a->[1] <=> $b->[1]} > map{[ $_, /^(\d+)/ ]} > keys %final_list) { > printf "%-s\n", $MyKey->[0]; > }
Given the behavior of <=> with strings beginning with a number, isn't this unecessary? What if the string contains a negative or floating-point number? Leading blanks? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]