in reply to Re^2: How to get the index of smallest whole number in an array?
in thread How to get the index of smallest whole number in an array?
But, what's with the [ 0 ] at the end?
my @arr = ( 3, 4, 71, 1, -598, -100203 ); say for ( sort { $arr[ $a ] <=> $arr[ $b ] } grep { $arr[ $_ ] >= 0 } 0 .. $#arr )[ 0 ]; # okay. what's with the [ 0 ] ??????
I really want to know!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to get the index of smallest whole number in an array?
by AnomalousMonk (Archbishop) on Jul 02, 2018 at 19:52 UTC | |
|
Re^4: How to get the index of smallest whole number in an array?
by BrowserUk (Patriarch) on Jul 02, 2018 at 19:07 UTC | |
by corenth (Monk) on Jul 02, 2018 at 20:35 UTC |