The script will not run in your browser; perl scripts run on a server. Review the bullet items under the "Prerequisites" heading of The Fool's Guide to CGI.pm,
the Perl module for CGI scripting, especially "...capabilities of using CGI scripting in Perl on some server as well as local information on how to do that."
Under the subsequent "Hello world" heading, it says that, "You should now know where to put your Perl programs in order to run them as CGI scripts and what you might need to do with them (setting file protections, perhaps)."
You'll either need to find a Web hosting service that supports Perl and CGI for your scripts or you can run a local Apache Web server with Perl and CGI on your own machine, e.g., XAMPP. Even if you opt for the former option, the latter provides a nice Perl CGI sandbox.