简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM