Results 1 to 3 of 3

Thread: Unsorted array of strings

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Answers
    3

    Unsorted array of strings

    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.


  2. #2
    Junior Member
    Join Date
    Jan 2008
    Answers
    9

    Re: Unsorted array of strings

    Show some effort man. You will surely get some help.


  3. #3
    Junior Member
    Join Date
    Oct 2007
    Answers
    5

    Re: Unsorted array of strings

    #!/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 arrayn go must Show World hello


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact