in reply to Finding the length of an aray in a hash
Given the way the data is organized, you can avoid the temporary array by counting the number of commas in a (hash) value then adding 1.
Instead of
try $length = 1 + $cant_make_day{$elim_key} =~ tr/,/,/; This assumes that you never allow an empty ("") value in your hash.@array = split /,/, $cant_make_day{$elim_key}; $length = @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding the length of an aray in a hash
by tallus (Initiate) on Apr 21, 2002 at 01:59 UTC |