Ana Vani
Ana Vani

Reputation: 51

Undefined subroutine CGI::radio

I have an application about a student data,and i am trying to make a radio-group which has options about gender of the student. But it shows me the following error: Undefined subroutine CGI::radio at C:/wamp/bin/apache/apache2.2.22/cgi-bin/modify.pl line 196

   $cInput .= $q->div({-class => 'control-group'},
                    $q->label({-class => 'control-label', -for => 'gender'}, "Gender:"), 
                    $q->div({class => 'controls'}, 
                    $q->span({class => 'span12'},
                    $q->label({-class => 'blue'},
                    $q->radio-group({-id => 'gender', -name => 'gender', -values => ['M','F'],-labels => \%labels, -default => $cGender, 'true'})))));  

What may be the problem?

Upvotes: 1

Views: 198

Answers (1)

Quentin
Quentin

Reputation: 944301

You are trying to call $q->radio-group but:

  1. The - is being treated as a subtraction operator
  2. The method is called radio_group (with an underscore)

See the documentation

Upvotes: 7

Related Questions