lakshmikant has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get last index of array but its printing the full array , please let me know where I am doing mistake
@numbers = (15,5,7,3,9,1,20,13,9,8, 15,16,2,6,12,90); @a = join ("," ,(sort {$a <=> $b} @numbers)); print "@a\n"; print $a[-2];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: not able to get last index of array
by haukex (Archbishop) on Jun 01, 2016 at 14:21 UTC | |
|
Re: not able to get last index of array
by ww (Archbishop) on Jun 01, 2016 at 14:16 UTC | |
by Lotus1 (Vicar) on Jun 04, 2016 at 15:36 UTC | |
by AnomalousMonk (Archbishop) on Jun 04, 2016 at 15:50 UTC | |
by Lotus1 (Vicar) on Jun 04, 2016 at 16:09 UTC | |
|
Re: not able to get last index of array
by hippo (Archbishop) on Jun 01, 2016 at 14:15 UTC | |
|
Re: not able to get last index of array
by Marshall (Canon) on Jun 01, 2016 at 18:41 UTC | |
|
Re: not able to get last index of array
by Laurent_R (Canon) on Jun 01, 2016 at 20:37 UTC | |
|
Re: not able to get last index of array
by anonymized user 468275 (Curate) on Jun 02, 2016 at 11:43 UTC | |
by hippo (Archbishop) on Jun 02, 2016 at 12:46 UTC |