in reply to Questions about split

To answer your first question, you could just do this: $field_i_want = (split /:/)[2]; That just creates a single element slice of the list returned by split. If you only wanted elements 2 and 5 you could do this: ($want1,$want2) = (split /:/)[2,5];