Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: WML and Perl

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2025-02-07 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.