<?xml version="1.0" encoding="windows-1252"?>
<node id="998041" title="Re^3: Compilation error" created="2012-10-09 12:41:57" updated="2012-10-09 12:41:57">
<type id="11">
note</type>
<author id="622051">
toolic</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
1. When do I use 'my' before an array and when don't I?&lt;/i&gt;&lt;/blockquote&gt;

Only when you first declare the array variable.

&lt;blockquote&gt;&lt;i&gt;
Does this code '{$a &lt;=&gt; $b}' work with only numbers? &lt;/i&gt;&lt;/blockquote&gt;

Yes.  You want &lt;c&gt;cmp&lt;/c&gt; ([doc://perlop] and [doc://sort])
&lt;c&gt;
use warnings;
use strict;

my@array = qw(one two three four five six seven eight nine ten);
print "The original array contains - @array \n";
my@sorted = sort {$a cmp $b} @array;

print "The sorted array contains @sorted \n"; 
&lt;/c&gt;


&lt;p&gt;You should also use "code" tags for your error/warning messages.</field>
<field name="root_node">
998032</field>
<field name="parent_node">
998040</field>
</data>
</node>
