Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Syntactic Confectionery Delight
 
PerlMonks  

Re: WML and Perl

by le (Friar)
on Jul 27, 2000 at 11:06 UTC ( [id://24656]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to WML and Perl

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?)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://24656]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.