<?xml version="1.0" encoding="windows-1252"?>
<node id="1003644" title="ordering array of sentences" created="2012-11-13 11:00:26" updated="2012-11-13 11:00:26">
<type id="115">
perlquestion</type>
<author id="872655">
welle</author>
<data>
<field name="doctext">
&lt;p&gt;
I have an array (@sentences) containing sentences, for example&lt;/p&gt;
&lt;code&gt;
I am searching for a word
What are you searching for?
Today I have been searching for a new job
&lt;/code&gt;
&lt;p&gt;
I would like to sort them alphabetically according to the word on the left side of the word @query="searching". The sorted order would be:
&lt;/p&gt;
&lt;code&gt;
I am searching for a word
Today I have been searching for a new job
What are you searching for?
&lt;/code&gt;
&lt;p&gt;Any ideas how to get started? I am really stuck... I guess, I should use split (\s), maybe map or index, and of course cmp. But I have really no idea how to start...So, any idea would be appreciated&lt;/p&gt;</field>
</data>
</node>
