<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'sort array and return index' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'sort array and return index' posted on the 'Perl' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 23:02:24 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 23:02:24 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>sort array and return index</title>
      <link>http://www.programmersheaven.com/mb/perl/418442/418442/sort-array-and-return-index/</link>
      <description>hello all, i'm trying to do something simple, but i was hoping there might be an easy and efficient way to do it. i'm currently using sort to find the max value in an array:&lt;br /&gt;
&lt;br /&gt;
my $max = (sort {$b &amp;lt;=&amp;gt; $a} @y)[0];&lt;br /&gt;
&lt;br /&gt;
but i'm wondering if there is a way to get sort (or some other built in function) to return the original index of this value. right now i have a naive for loop doing the job, and i need to speed it up and was hoping to avoid writing a more efficient search routine myself.&lt;br /&gt;
&lt;br /&gt;
thanks,&lt;br /&gt;
JR</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/perl/418442/418442/sort-array-and-return-index/</guid>
      <pubDate>Wed, 25 Aug 2010 12:26:35 -0700</pubDate>
      <category>Perl</category>
    </item>
  </channel>
</rss>
