in reply to converting user friendly regex to perl friendly

Why convert it, when you can easily just change it to a set of if statements and eval that?

Note, completely untested code, written from memory

if($_ =~ s/\[(\d+)-(\d+)\]/){ s/\[(\d+)-(\d+)\]/command if(\$x >= $1 && \$x <= $2);/; eval $_; }
Most likely this code won't compile, but it's a starting point.

==
Kwyjibo. A big, dumb, balding North American ape. With no chin.