Validating radio buttons in perl
Unlike simple regexes, it recognizes negative numbers and decimal strings just fine, but it has its own quirks that you should know about.
For example, all of these strings “look like numbers”: Another edge case in Perl is that the act of observing a scalar’s value can change the scalar’s type from number to string.
In this tutorial you will learn how to write a Perl CGI form.
If you have never done any Perl CGI programming before, we suggest you first look at the CGI Tutorial.
Class sizes are kept small so students have accessibility to ask questions, get help when they need it, and receive appropriate guidance.
You need a training company that will lower your risk and assure your success – every time. And we guarantee that IT training from HOTT will be more cost effective than training from any other source.
A complementary technique to using a regex is to use the function from Scalar:: Util.
This is a boolean function which returns true if the variable looks like a number to the Perl interpreter.
Our instructors are working professionals with an average of over 10 years of teaching experience.
This will work for a wide-range of number types, including the really-large numbers Perl converts to decimal string (of dubious benefit! Your application’s requirements determine which types of numbers you should accept, just keep in mind that the more varieties of number you accept, the more complicated the validation becomes.
If you’re familiar with these edge cases however, the task becomes a little easier.
The CGI module provides interfaces to more form fields than these, but these are the most common.
Text: Single radio buttons don't make much sense in a web form, so they are not addressed by the CGI module.