Radio Buttons
Radio buttons are used to select one out of several choices. This can be used for such things as designating a sex or marital status. Using raw HTML, you create radio buttons using the INPUT tag with TYPE radio. The CHECKED attribute can be used to specify which button to initially highlight. The following example shows how to highlight the button for selecting "male".
<INPUT TYPE=radio NAME='sex' VALUE='male' CHECKED> <INPUT TYPE=radio NAME='sex' VALUE='female'>
Because radio buttons are generally created in groups, CGI::Form provides a single interface for creating a group of radio buttons. This method is called radio_group, as shown here:
$q->radio_group( -name=>'sex', values=>[`male', `female'], -default=>'female',
-linebreak=>'true' );
The -linebreak option causes the buttons to be laid out vertically aligned.