It all depends:
- can the same username appear more then once, but with different ip addresses? If not, use a hash with the username as the key and a arrayref containing ip addresses as the value.
- - can the same ip address appear more then once, but with different usernames? If not, then do the opposite as 1.
If both can appear multiple times, you best use the combination username-ip-address as the key of a hash. Then either use a arrayref with username and ip address as the vaule and use tis array as the data for your datavase-insert or split the hash key and use that.
HTH,
Paul