in reply to grep using substr

Why do you need to define your own scalar, and why is that a problem?