Question on Unsorted Array? Help?
You have unsorted array of strings, like:
my @arr = qw(hello World Show must go on);
Print this array, sorted in reversed case-insensitive order.
Guys Please help me solve this problem. Appreciate it.
Printable View
Question on Unsorted Array? Help?
You have unsorted array of strings, like:
my @arr = qw(hello World Show must go on);
Print this array, sorted in reversed case-insensitive order.
Guys Please help me solve this problem. Appreciate it.
Show some effort man. You will surely get some help.
#!/usr/bin/perl
use strict;
my @array=qw(hello World Show must go on);
my $first_str;
my $second_str;
my @rev_sorted=reverse( sort { lc $second_str cmp lc $first_str } @array) ;
print "\n Rev_Sorted array:@rev_sorted";
exit;
Ans is :
Rev_Sorted array:on go must Show World hello