in reply to splitting array values
First it sounds like you don't really know what is in $score[0] (note not @score[0], though that may work). To get around this,
This will tell you what is actually in @score, where the first element will be $score[0].use Data::Dumper; print Dumper(\@score);
Also, an array doesn't really contain another array. arrays can only contain scalars, though one type of scalar is a refrence, which can be thought of as a pointer to another array. If $score[0] is such a reference to an array, the correct notation is:
This properly de-references the referance to feed an array into the sort.@sorted= reverse sort { $a <=> $b } @{$score[0]};
All code given here is UNTESTED unless otherwise stated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: splitting array values
by mkurtis (Scribe) on May 20, 2004 at 01:44 UTC | |
by VSarkiss (Monsignor) on May 20, 2004 at 02:10 UTC | |
by mkurtis (Scribe) on May 20, 2004 at 04:05 UTC |