Upgrade from 2.9.51 to 3.11 Scrip does not work, Help

I have such script

:global IP "192.168.23.45" ;
/ping $IP count=3 ;
:global tmpmac [/ip arp get [/ip arp find address=$IP ] mac-address] ;
:log error $tmpmac ;
:if ([/ip arp get [/ip arp find mac-address=$tmpmac] interface] = bridge1) do [:global tmpbr [/interface bridge host get [/interface bridge host find mac-address=$tmpmac] on-interface] ;
:log error $tmpbr; ] else=[:global other [/ip arp get [/ip arp find mac-address=$tmpmac] interface ];
:log error $other ;

this script was working very well untill I had upgrated to 3.11 ,
Why does not this script work?
Who can help me?


Thanks

Try 3.12. Some upgrades were made to the scripting to make some broken syntax in 3.11 work again in 3.12.