keys(%{$lang}))
Sean
- Original Message - From: "Mike Blezien" <[EMAIL PROTECTED]>
To: "Sean Davis" <[EMAIL PROTECTED]>
Cc: "Perl List"
Sent: Friday, June 03, 2005 7:36 PM
Subject: Re: hash array sorting
How that apply to our code:
foreach $key
Untested:
foreach $key (sort { lc($lang->{$a}->[0]) cmp lc($lang->{$b}->[0]) }
keys(%{$lang}))
Sean
- Original Message -
From: "Mike Blezien" <[EMAIL PROTECTED]>
To: "Sean Davis" <[EMAIL PROTECTED]>
Cc: "Perl List"
Sent:
Architecture;Local Language
4::Art&design;Local Language
5::Biochemistry;Local Language
60::abcnews;local language
###
Then we sort the file on the first hash array element [0]. Now it
sorts all alphabetically fine, except if the char
file on the first hash array element [0]. Now it
sorts all alphabetically fine, except if the characters start in lower
case, then it's the last in the list after all others sorted. this is
the code we use to do the sort.
foreach $key (sort { $lang->{$a}->[0] cmp $lang->{$b
ge
4::Art&design;Local Language
5::Biochemistry;Local Language
60::abcnews;local language
###
Then we sort the file on the first hash array element [0]. Now it sorts all
alphabetically fine, except if the characters start in lo
--- Mike Blezien <[EMAIL PROTECTED]> wrote:
> > Arrays in scalar context return the number of elements in the
> array.
> > Try this:
> >
> > my $num_elements = @{ $hash->{$key };
> >
>
> thank you :)
You can thank me after I post a *correct* code snippet :)
my $num_elements = @{ $hash->{$
Ovid wrote:
--- Mike Blezien <[EMAIL PROTECTED]> wrote:
what is the correct proceedure to check the number of elements in a
hash array,
when extracting elements like
$hash->{$key}->[0],$hash->{$key}->[1],.etc is
there way to determine the number of elements [ ] in the
$hash-
--- Mike Blezien <[EMAIL PROTECTED]> wrote:
> what is the correct proceedure to check the number of elements in a
> hash array,
> when extracting elements like
> $hash->{$key}->[0],$hash->{$key}->[1],.etc is
> there way to determine the number of elements [ ] in
Hello,
what is the correct proceedure to check the number of elements in a hash array,
when extracting elements like $hash->{$key}->[0],$hash->{$key}->[1],.etc is
there way to determine the number of elements [ ] in the $hash->{$key} if is
not known so each element can be