in reply to how to check contents of my array ref
I would take a different approach. You state that "each line has an indicator". Why not have a hash with each indicator as a key. The value for each key would then be a reference to a subroutine to be executed for that type of data. It is then a fairly simple generic call, assuming the indicator is defined.