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;
In reply to Re: Finding the length of an aray in a hash
by dws
in thread Finding the length of an aray in a hash
by tallus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |