I'm a little amazed this works but it does. :)
@nums = qw(55_20051202 56_20051203 57_20051204 101_20051205 59_20051206
10_20051207 61_20051208 62_20051208 63_20051208 64_20051209 65_20051209
66_20051210 67_20051211 68_20051212 69_20051213 70_20051214);
print join \n, (map {join _, @{$_}} (sort
- Original Message -
From: Chris Wagner [EMAIL PROTECTED]
To: perl-win32-users@listserv.ActiveState.com
Sent: Sunday, December 18, 2005 9:26 AM
Subject: Re: Sort question
I'm a little amazed this works but it does. :)
@nums = qw(55_20051202 56_20051203 57_20051204 101_20051205
[EMAIL PROTECTED] wrote:
Hi Guys,
I have an array of values. How can I sort these values that has
a non numeric character [ _ ] in it? What I did was parse the numbers
before the _ character and then perform a number short on those
value, but there must be an easier way? Any help is
On 12/16/05, Wong, Danny H. [EMAIL PROTECTED] wrote: Hi Guys, I
have an array of values. How can I sort these values that has a non numeric
character [ _ ] in it? What I did was parse the numbers before the _
character and then perform a number short on those value, but there must be an
I have an array of values. How can I sort these values that has
a non numeric character [ _ ] in it? What I did was parse the numbers
before the _ character and then perform a number short on those
value, but there must be an easier way? Any help is greatly
appreciated.
55_20051202
- Original Message -
From: Wong, Danny H. [EMAIL PROTECTED]
To: perl-win32-users@listserv.ActiveState.com
Sent: Saturday, December 17, 2005 7:04 AM
Subject: Sort question
Hi Guys,
I have an array of values. How can I sort these values that has
a non numeric character [ _ ] in it?
$Bill Luebkert wrote:
Michael Meltzer wrote:
The following strings I have in an array:
xyz
abcd
ZABC
if I do @sorted = sort(@unsorted) I get
ZABC
abcd
xyz
I would like to sort this strings alphabetical ignoring capitalisation but
whithout changing the output format.
Try:
@sorted = sort {uc $a cmp uc $b) (@unsorted);
This compares (cmp) the upper case of the two values (uc) without modifying
them.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Meltzer
Sent: Wednesday, December 15, 2004 1:44 PM
To:
Michael Meltzer wrote:
The following strings I have in an array:
xyz
abcd
ZABC
if I do @sorted = sort(@unsorted) I get
ZABC
abcd
xyz
I would like to sort this strings alphabetical ignoring capitalisation but
whithout changing the output format.
I want to get this:
abcd
xyz
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Michael Meltzer
Sent: Wednesday, December 15, 2004 2:44 PM
To: Perl-Win32-Users
Subject: sort question
The following strings I have in an array:
xyz
abcd
Just parse each line ($a and $b) within your sort subroutine, e.g.:
#!/usr/bin/perl
sub sorter {
my (@a,@b);
@a = split(/\s+/,$a);
@b = split(/\s+/,$b);
@a[1] = @b[1];
}
@lines = ;
print sort sorter @lines;
-Jonathan
At 11:32 AM 1/3/2002, Peter Eisengrein wrote:
This is probably
-Original Message-
Behalf Of Peter Eisengrein
This is probably really easy but I couldn't find it in the docs. I have a
multicolumn list that has between 5000-6000 lines and looks something like
this:
47 3950 0 Y Y N N OOSM
70
Thanks for the help with sort. Anyone aware of a module to connect to a
remote host over the old DECnet LAT protocol? cpan yielded no matches but I
thought maybe there was something out there...
-Original Message-
From: Peter Eisengrein [mailto:[EMAIL PROTECTED]]
Sent: Thursday,
13 matches
Mail list logo