The relationship between Perl and CGI is often confused, mostly because they are frequently seen together. This occurs so often, in fact, that the term “Perl CGI” became commonplace. In reality, any number of programming languages can be used with the Common Gateway Interface. (more…)

The following are scripting examples of content negotiation using the HTTP Accept header.

These examples are used to properly serve XHTML with the proper MIME media type of application/xhtml+xml. If the request header does not allow this media type, it will be served as text/html. This convention follows the W3C standard for “Recommended Media Type Usage:” See the examples