Hi

     I would like to do some custom sorting with some hash data that I have
stored.  It will be used in a mod_perl application so I would like to ensure
that the variables are safe and local.  My worry is that I plan to call a
subroutine with sort but I have no idea how to pass the variables or if I
even have to.  Here is what I am planning.  Any advice or links would help.
Thanks a lot.  Mike

@sortedkeys = sort by_field keys(%names);

sub by_fields {
   my ($first_compare,$first_extra) = $names{$a};
   my ($second_compare,$second_extra) = $names{$b};
   ### I am spliting the value to sort on a secondary field other than the
key
   ($first_compare <=> $second_compare || $first_extra <=> $second_extra);
}

Reply via email to