I suppose you're talking about Perl as a server scripting
language, delivering WML-pages to WAP enabled devices.
Since it is just a question af MIME-types and content-types
to determine what's WML and what not (and what the server
serves), one just has to add the correct MIME-Type to the
server conf and output pure WML. (Ok, right now, there's
no CGI.pm with WAP support, but who knows?)
Add these MIME-types:
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
to your server conf.
And this would be a small CGI WAP example:
#!/usr/bin/perl -w
use CGI qw(:standard);
use strict;
my $q = new CGI;
# This determines being WML or not.
print header(-type => 'text/vnd.wap.wml');
print "<?xml version=\"1.0\"?>\n";
print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://
+www.wapforum.org/DTD/wml_1.1.xml\">";
# This is the actual WML content.
print "<wml>\n";
print "<card id=\"main\" title=\"Hello World\">\n";
print "<p>Hello, " . $q->param("f") . " " . $q->param("l") . "!</p>\n"
+;
print "</card>\n";
print "</wml>\n";
Update: Just saw ar0n's post, didn't know there's a
CGI::WML module.
Nice. (But to be honest: who needs WAP anyway?) |