Why do I see an error message saying “Undefined subroutine CGI::startform” with my Perl script?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

If you use a Perl CGI script and see the error message “Undefined subroutine CGI::startform”, this is happening because your script is out of date.

Scripts with this problem use a third-party Perl module called CGI.pm. That module changed the name of the startform function to start_form in 2009, and removed the old name completely with version 4.04 in 2014. Our servers started using this newer version in 2018.

The author of the script you use has probably released a new version that fixes the function name and works properly. Installing that newer version should solve this.

If you’ve written your own CGI script, see the “STARTING AND ENDING A FORM” section of the CGI.pm documentation. As it mentions, “These methods were previously named startform() and endform(). These methods are now DEPRECATED. Please use start_form() and end_form() instead”.

Can I install an older version of CGI.pm to avoid this problem?

If you want your script or code to keep working as it always did, another possibility is to simply use a private copy of CGI.pm version 3.65 from before these changes.

To see the exact instructions for doing this on your site, enter your domain name in the box above.