<?xml version="1.0" encoding="windows-1252"?>
<node id="998040" title="Re^2: Compilation error" created="2012-10-09 12:30:38" updated="2012-10-09 12:30:38">
<type id="11">
note</type>
<author id="994288">
truthseeker66</author>
<data>
<field name="doctext">

1. When do I use 'my' before an array and when don't I? &lt;br&gt;

2. Now with this script I get an error. Does this code '{$a &lt;=&gt; $b}' work with only numbers? 
&lt;code&gt;
#!/usr/bin/perl
use strict;
use warnings;

my@array = qw(one two three four five six seven eight nine ten);
print "The original array contains - @array \n";
my@sorted = sort {$a &lt;=&gt; $b} @array;

print "The sorted array contains @sorted \n"; &lt;/code&gt;

&lt;p&gt;
The original array contains - one two three four five six seven eight nine ten &lt;br&gt;
Argument "one" isn't numeric in sort at C:\JPARK\JPERL\test.pl line 7. &lt;br&gt;
Argument "two" isn't numeric in sort at C:\JPARK\JPERL\test.pl line 7. &lt;br&gt;
Argument "three" isn't numeric in sort at C:\JPARK\JPERL\test.pl line 7. &lt;br&gt;
.
.
.
The sorted array contains one two three four five six seven eight nine ten
&lt;/p&gt;</field>
<field name="root_node">
998032</field>
<field name="parent_node">
998035</field>
</data>
</node>
