use strict; use warnings; while () { if (/ip helper-address/) { print; print " ip helper-address x.x.x.x\n"; print " ip helper-address x.x.x.x\n"; } else { print; } } __DATA__ ! interface GigabitEthernet1/0/1 description *** VLAN 1 ** no switchport ip address x.x.x.x x.x.x.x ip helper-address x.x.x.x no ip redirects no ip proxy-arp service-policy input U_SET_DSCP ip ospf cost 10 srr-queue bandwidth share 1 3 97 1 priority-queue out standby ip x.x.x.x standby timers 1 3 standby priority 95 standby preempt !