in reply to Re^2: unxpected sort warnings while using sort
in thread unxpected sort warnings while using sort
The way most programmers would expect to see your data is like this:
If, instead, it looks like this:2 3 3 3 5 7 8 12 ...
then you have a problem .. or rather, it needs to be handled differently in your code.2 3 3 3 5 7 8 12 ...
For the second case, you need:
my @data = split /\s+/,<$in>;
In addition, the way the "sort_num" is called has some issues in your code.
This is how it should be called:
And call it only ONCE.my @new_sort = sort_num (@data);
"Despite my privileged upbringing, I'm actually quite well-balanced. I have a chip on both shoulders." - John Nash
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: unxpected sort warnings while using sort
by perlynewby (Scribe) on Jul 23, 2015 at 20:30 UTC | |
by AnomalousMonk (Archbishop) on Jul 24, 2015 at 00:19 UTC | |
by NetWallah (Canon) on Jul 23, 2015 at 22:33 UTC | |
by perlynewby (Scribe) on Jul 24, 2015 at 23:03 UTC |