in reply to Re: RFC: Who wants to design a better SNMP API?
in thread RFC: Who wants to design a better SNMP API?

Posting anonymously so people don't think I'm begging for XP

Just for fun, Here's what the above code would look like if I eliminated all the temporary variables...
my $snmp1 = $sess->gettable( adMX2820M13StatDS3Table, columns => ['adMX2820M13PrvCardPairID',], ); my $snmp2 = $sess->gettable( adGenPortSlotMapTable, columns => ['adGenSlotAddress',], ); my $snmp3 = $sess->gettable( adMX2820M13PrvSlotTable, columns => ['adMX2820M13NetFuncServState',], ); # wheeeeee! my $result = extract_value( match_by_value( $snmp3, sub { $_ in( extract_index_val( 0, match_by_value( $snmp2, sub { $_ in( extract_index_val( 0, and( match_by_value( $snmp1, sub { $_ !~ /not in use/i } ), match_by_value( $snmp1, sub { $_ != '' } ) ) ) ) } ) ) ) } ) );