in reply to Re^4: Flat file handling
in thread Flat file handling

Few things.
1. Why capture $unique and $componen_number, since you aren't using them anywhere?
2. You don't need $elements_in_array, $#array will give the last elements number.
$elements_in_array = scalar(@array); $last_element_index = $#array; $last_element = $array[$#array]; # $#array is one less than the number of elements in array # as first index in array is 0 # this is always true if (scalar(@array) == $#array + 1) {};
3. Push things to your arrays immeadiately, instead of waiting for the next row. It makes it easier to follow whats happening later (at least I think so :)).