Hi folks,
I am sure I've seen this before long ago but I cant find it back by searching.
How do I sort a list like:
Aa
aa
B
b
instead of:
A
Z
a
z
(so case sensitive is ignored?)
The code I am using now is:
---------------------------
for ($i = 0; $i <= $#db_cols; $i++) {
#### In the line below, replace 'Category' with the name of your field.
if ($db_cols[$i] eq "Userid" ) {
$fieldnum = $i; $found = 1;
last;
}
}
if ($found) {
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$count1{$fields[$fieldnum]};
}
close DB;
foreach $option (sort keys %count1) {
------------------------
which returns:
A-Z
and then
a-z
Rock & Roll
Close Watch
I am sure I've seen this before long ago but I cant find it back by searching.
How do I sort a list like:
Aa
aa
B
b
instead of:
A
Z
a
z
(so case sensitive is ignored?)
The code I am using now is:
---------------------------
for ($i = 0; $i <= $#db_cols; $i++) {
#### In the line below, replace 'Category' with the name of your field.
if ($db_cols[$i] eq "Userid" ) {
$fieldnum = $i; $found = 1;
last;
}
}
if ($found) {
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$count1{$fields[$fieldnum]};
}
close DB;
foreach $option (sort keys %count1) {
------------------------
which returns:
A-Z
and then
a-z
Rock & Roll
Close Watch