loop {
   if prompt("input: ") ~~ /^(\d+)$/ {
       say ~$/ if 1 <= +$/ <= 100
   }
}

정규식 사용이야 치트키라고 쳐도 1 < x < 3가 가능함. ㅅㅌㅊ?