It's not necessarily a cgi script, more just the way you tell the webserver to handle the request.
In the simplest example, you tell the webserver, to use a certain script as your index file.
In the example for perlmonks, it seems there is an index.pl there, which is handling the request by default.
http://www.perlmonks.org/index.pl?node=Cowboy
is the same as
http://www.perlmonks.org/?node=Cowboy
Check out the docs on
DirectoryIndex