note
toolic
<blockquote><i>
1. When do I use 'my' before an array and when don't I?</i></blockquote>
Only when you first declare the array variable.
<blockquote><i>
Does this code '{$a <=> $b}' work with only numbers? </i></blockquote>
Yes. You want <c>cmp</c> ([doc://perlop] and [doc://sort])
<c>
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";
</c>
<p>You should also use "code" tags for your error/warning messages.
998032
998040