in reply to Undefined value

Why assume Config::IniFiles->new success? Doc say "undef" if the configuration file has an error, in which case check the global @Config::IniFiles::errors array for reasons why

Replies are listed 'Best First'.
Re^2: Undefined value
by Anonymous Monk on Jun 19, 2009 at 12:41 UTC
    sub translate_ifindex() { my $ports_ini_dir = "/home/portal/bin/conf/snmp_set"; my (@range_files) = ( [ 204, 381, "snmp_ports_slot02.txt", ] [ 22, 199, "snmp_ports_slot04.txt", ] [ 513, 690, "snmp_ports_slot06.txt", ] [ 823, 1000, "snmp_ports_slot08.txt", ] [ 1067, 1244, "snmp_ports_slot10.txt", ] [ 1311, 1488, "snmp_ports_slot12.txt", ] [ 1555, 1732, "snmp_ports_slot14.txt", ] [ 1799, 1976, "snmp_ports_slot16.txt", ] [ 2043, 2220, "snmp_ports_slot18.txt", ] [ 2287, 2464, "snmp_ports_slot20.txt", ] ); for ( my $t = 0 ; $t < @ifindex ; $t++ ) { for my $range_file (@range_files) { if ( $ifindex[$t] >= $$range_file[0] && $ifindex[$t] <= $$range_file[1] ) { my $cfg = new Config::IniFiles( -file => "$ports_ini_dir/$$range_file[2]" ); if ($cfg) { push @msan_slot, $cfg->val( $ifindex[$t], "slot"); push @msan_port, $cfg->val( $ifindex[$t], "port"); } else { warn "Ooops($$range_file[2]): @Config::IniFiles::e +rrors"; } } } } }
Re^2: Undefined value
by Ravendark (Acolyte) on Jun 19, 2009 at 12:44 UTC
    yes it dies... but I cannot figure out why it cannot open the specific file... It was working earlier...
      Error message tells you why.