in reply to Re: array sorting
in thread array sorting

I understand what you're saying Abigail, and it makes absolute sense that if all you want is an array interpolated into a string with single spaces between elements, you'll use "@array". But he was trying to sort, and wanted the results to be output with single-spaces between each element. Fine, but he was going about it by inventing syntaxes that simply didn't do what he wanted. For one, putting "@array" in quotes as an argument to sort.

And though interpolation has its place, you probably wouldn't recommend this (except for maybe in an obfu:

print "@{[sort @array]}";

Or maybe you would. There is always more than one way to do it. Though this method probably creates two copies of @array; one being an anonyomous array, and the second being the interpolated string.

Anyway, thanks for pointing out the overstatement of my post. You are (as is often the case) correct.


Dave