foreach $user (keys %{$ini{'Section2'}}) { ($pass, $uid) = split /:/, $ini{'accounts'}{$user}; #do something with the values here }