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:
How that apply to our code:
foreach $key (sort { $lang->{$a}->[0] cmp $lang->{$b}->[0] } keys(%{$lang}))
>> {
>> # do stuff here
>> }
Sean Davis wrote:
Look at using lc (lower case). It can make your sort case-insensitive.
On Jun 3, 2005, at 7:17 PM, Mike Blezien wrote:
Hello,
Look at using lc (lower case). It can make your sort case-insensitive.
On Jun 3, 2005, at 7:17 PM, Mike Blezien wrote:
Hello,
ran into a strange problem when doing a sort. we have a file like this:
0::Accounts;Local Language
1::Anatomy;Local Language
2::Arabic;Local Language
--- 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->{$key} if is
not kn
--- 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->{$key} if is
> not