http://www.perlmonks.org?node_id=1024206


in reply to Array problems.....

I'm guessing that hashes, references, and autovivification are beyond the op's skills at this point. I suggest that you:

  1. Create two arrays: @names224, @names225.
  2. Read each line and chomp() it.
  3. split() the line.
  4. If the second element in the array returned by split() is == to 224, then push() the first element of the array returned by split() onto @names224.
  5. If the second element in the array returned by split() is == to 225, then push() the first element of the array returned by split() onto @names225.
  6. The number of items in an array can be found by assigning the array to a scalar variable.

Good luck.