The Documentation states in 9.1 that "Arguments cannot be passed to CGI scripts running in an SSI environment on most servers". However, the 'exec cgi' SSI command will pass into the script any variable passed to the including page.
Consider a page 'page.shtml', that in turn has the following line:
<!--#exec cgi="/cgi-bin/calendar.pl"-->
If that page is linked to as in:
<a href="page.shtml?template=blah.html">
then the value of 'template' will be passed to calendar.pl. This will work for any number of variables; inside of the script, use $SCRIPT_NAME and $QUERY_STRING, rather than $CGI_URL_QUERYSTRING.
Additionally, on Apache, static values can be passed into SSI-based templates using something like this:
<!--#include virtual="/cgi-bin/calendar.pl?template=blah.txt"-->
It may be worthwhile to update the documentation, which describes the SSI usage in a rather pessimistic way, while in fact it's as good as "straight up"...