please help SNMP dynamic configuration using perl

Hi there I new to perl and SNMP....I need to write a trap handler in Perl that handle traps in SNMP environment such as link up/down and also it must do some configuration as a respond/correct to what happen,in my case I look for linkdown status and it should turn the alternative port up,that's allso fa r I got the:1- snmptrapd.conf file