<div dir="ltr">On Fri, Apr 5, 2013 at 2:46 PM, Uri Guttman <span dir="ltr"><<a href="mailto:uri@stemsystems.com" target="_blank">uri@stemsystems.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br></div>
sort takes a sub name for its first arg if that is a bareword. so you are sorting the whole list but using uniq as the comparison function.<br>
<br>
try putting parens around the list so uniq looks like a sub. or parens around uniq and the list but that is wrong because sort defaults to alpha sorting and that will only work on numbers of the same length.</blockquote>

<div><br></div><div style>Oh, I had tried parens, but I guess it's still seen as a barword.</div><div><br></div><div><div>$ perl -wle 'use Data::Dumper; use List::MoreUtils "uniq";  print Dumper [sort uniq( 3,1,3,2)]'</div>

<div>$VAR1 = [</div><div>          1,</div><div>          2,</div><div>          3,</div><div>          3</div><div>        ];</div></div><div><br></div><div style>as well as "sort (uniq 3,1,3,2)"</div><div><br>

</div><div><br></div><div style><br></div><div style>Does the plus sign tell sort it's not a bareword in this case?</div><div><br></div><div><div>$ perl -wle 'use Data::Dumper; use List::MoreUtils "uniq";  print Dumper [sort +uniq 3,1,3,2]'</div>

<div>$VAR1 = [</div><div>          1,</div><div>          2,</div><div>          3</div><div>        ];</div></div><div><br></div><div style>Yes, still need to deal with the numeric sort, but I was just using that list as an example.</div>

<div><br></div><div><br></div><div><br></div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</div></div>