![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sort and Unique in Perl | deepakwins | Shell Programming and Scripting | 20 | 02-11-2008 09:25 PM |
| sort and uniq in perl | reggiej | Shell Programming and Scripting | 4 | 05-18-2006 11:46 PM |
| sort a file by date using perl | esham | Shell Programming and Scripting | 4 | 04-14-2005 02:04 PM |
| sort function | dbargo | High Level Programming | 2 | 11-21-2002 05:14 PM |
| Sort file in perl | annececile | Shell Programming and Scripting | 4 | 06-21-2002 09:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, here is my perl script.This script creates an array and is sorting it using the in-built sort function in perl. Code:
#!/usr/local/bin/perl
my number=6;
my @num_arr=(1,2,3,4,5);
my @array=(23,"$number","Hello",2.345,@num_arr);
#printing the array
print "@array\n";
#sorting the array
my @sorted = sort @array;
print "Sorted : @sorted\n";
The output is an shown below: 23 6 Hello 2.345 1 2 3 4 5 Sorted : 1 2 2.345 23 3 4 5 6 Hello Can anyone suggest why the sort function act differently? With Regards Dileep Pattayath |
|
||||
|
What is "differently"? It appears expected for me.
From the sort documentation: Quote:
|
![]() |
| Bookmarks |
| Tags |
| perl sort |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|