if by key order then"
    @application_k = sort keys %GSIS::PROD_APPLICATION;

if by value order by key order then:
     @application_k =
         map {$_->[0]}
         sort {$a->[1] <=> $b->[1] || $a->[0] cmp $b->[0]}
         map {[$_ , $GSIS::PROD_APPLICATION{$_}]}
         keys %GSIS::PROD_APPLICATION;

the second one is called a schwartzian transform.  u should be
able to find an explanation of it on the web.

Andy Lim wrote:

> Hello.
> I want to sort a hash which contaning key-value pair for a list checkbox
> (like below) so that it print in the specific order.
> Anyone know how to do this?
> ------------------------------------
> [-
>         @application_k = keys %GSIS::PROD_APPLICATION;
>         @application_v = values %GSIS::PROD_APPLICATION;
> -]
>
> <input type="checkbox" name="app_type" value="[+ $application_k[$row] +]">
> [+ $application_v[$row] +]
>

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to