in reply to Handling different sections in config files

Another solution would be to "standardize" the config file so that each section followed the same format.
[Section2] user1=pass1:50 user2=pass2:51
Then simply use Config::IniFiles to tie the file to a hash:

tie my %ini, 'Config::IniFiles', ( -file => "MyConfig.ini" );
Then to retrieve the data from 'Section2':
foreach $user (keys %{$ini{'Section2'}}) { ($pass, $uid) = split /:/, $ini{'accounts'}{$user}; #do something with the values here }