Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Unsorted array of strings

This is a discussion on Unsorted array of strings within the PERL forums, part of the Web Development category; 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 ...

Go Back   Geeks Talk > Web Development > PERL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

PERL PERL Scripts - Tips, Tricks, Issues, Latest News, PERL Resource and PERL related topics can be discussed in this forum.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-14-2008
Junior Member
 
Join Date: Jan 2008
Location: Singapore
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
heidi012979 is on a distinguished road
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.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-24-2008
Junior Member
 
Join Date: Jan 2008
Location: India
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
realnapster is on a distinguished road
Re: Unsorted array of strings

Show some effort man. You will surely get some help.
Reply With Quote
  #3 (permalink)  
Old 02-06-2008
Junior Member
 
Join Date: Oct 2007
Location: India
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
amitbhosale is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Web Development > PERL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
convert one dimansional array to two dimansional array Geek_Guest C and C++ 6 12-22-2007 04:17 AM
static array or dynamic array? rpgubba C and C++ 6 12-22-2007 04:03 AM
character array pbchaudhari C and C++ 2 10-27-2007 04:41 AM
How DUAL diplays strings of length more than 1 Geek_Guest SQL 2 08-10-2007 07:10 AM
How to split this entire row's contents into separate strings JobHelper SilkTest 0 01-03-2007 05:32 PM


All times are GMT -4. The time now is 09:19 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved