http://qs1969.pair.com?node_id=1138948

PilotinControl has asked for the wisdom of the Perl Monks concerning the following question:

Good Evening Monks!

I have a light sensor and I need to capture a numeric range from the serial monitor to which I've already done commands using simple letter matches. Number matches I am completely lost with outside of the normal $data == 5 (do something) and so on. I need to capture a range of 200-300 and 400-500 so I can issue a command based on any number within that range. For example:

if ($range ==/300-400/) { exit; } if ($range == /425-500/) { print STDOUT "LIGHTS ON"\n; }

and so on. Of course I know that it is not that simple. I do believe it has to do with regexp and numerical expressions? Thanks in advanced!