in reply to Undefined value

First I think I'd check that
my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/snmp_ports_sl +ot20.txt" );
succeeded. Perhaps something like
my $cfg_file = q{$ports_ini_dir/snmp_ports_slot20.txt}; my $cfg = Config::IniFiles->new( -file => $cfg_file) or die qq{cant open *$cfg_file*: $!};