1. When do I use 'my' before an array and when don't I?Only when you first declare the array variable.
Does this code '{$a <=> $b}' work with only numbers?Yes. You want cmp (perlop and sort)
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";
You should also use "code" tags for your error/warning messages.
In reply to Re^3: Compilation error
by toolic
in thread Compilation error
by truthseeker66
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |