in reply to Re: How can I add an entry in a has of arrays based on numeric comparison?
in thread How can I add an entry in a has of arrays based on numeric comparison?

Aha, thanks!
So, I must change the structure to HoH instead of HoA to achieve the desired result?
(All these advanced structures seem so complicated to me!!!!)
  • Comment on Re^2: How can I add an entry in a has of arrays based on numeric comparison?

Replies are listed 'Best First'.
Re^3: How can I add an entry in a has of arrays based on numeric comparison?
by AppleFritter (Vicar) on Jun 26, 2014 at 09:51 UTC

    You don't have to; you can continue using a HoA as well, replacing (say) ->{'iEvalue'} with ->[0] and ->{'range_b'} with ->1. If you did this, the result for your sample data would be:

    $VAR1 = { 'I5EU07' => [ '3.4e-137', '232-824' ] };

    It's pretty much the same thing, but I personally prefer using hashes over arrays unless my "keys" are naturally numeric; you have to type a bit more, but your code'll be self-documenting. It's always obvious what ->{'iEvalue'} means, even years later when you're reading someone else's code, but the same is not true for ->[0].

      Thank you for the tips and code! Greatly appreciated!
        You're welcome! *tips hat*