in reply to matching pattern question?

Can't you just do this?

if($string =~ m/111/){

or have I misunderstood the question?

cheers, Chris