Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

arrays

below shows how to sort numeric and string arrays respectively

if ($numericdata eq "TRUE")

    {@newarray = sort{$a <=> $b}@newarray;}

    else {@newarray = sort(@newarray);}

 

To use a here-document to assign / initialise an array, one line per element, you might use an approach like this:

    @sauces = <<End_Lines =~ m/(\S.*\S)/g;

 normal tomato

 spicy tomato

 green chile

 pesto

 white wine

    End_Lines