Help for this page

Select Code to Download


  1. or download this
    die("Bad type\n") unless Net::SNMP->can($bah);
    $bah = Net::SNMP->$bah();
    
  2. or download this
    %is_valid_type = map { $_ => 1 } (
                        @{$Net::SNMP::Message::EXPORT_TAGS{'types'}}
    ...
    
    die("Bad type\n") unless $is_valid_type{$bah};
    $bah = Net::SNMP::Message->$bah();
    
  3. or download this
    %type_map = map { $_ => Net::SNMP::Message->$_() } (
                   @{$Net::SNMP::Message::EXPORT_TAGS{'types'}}
    ...
    
    $bah = $type_map{$bah}
    or die("Bad type\n");
    
  4. or download this
    %type_map = map {
                   my $type_num = Net::SNMP::Message->$_();
    ...
    
    $bah = $type_map{$bah}
    or die("Bad type\n");