Writing a Pattern-Based Rule in RoLex RoLex provides FSM machinery, so rules are simple. (41 LOC for next-hop test from previous slide) Rules specify "nodes" and "transitions". $no_nh_self_ebgp = sub { print STDERR $fsm->substitute_def_bindings("ebgp: no next-hop-self _r1 (_n2)\n"); $fsm->transition('_r1: router bgp _a1 [[ network _n3 mask _m3 ]]',1)->($OK); &$ERROR('_n2 not in iBGP/IGP (eBGP session)'); }; Network-wide checking is automatic!