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

WML and Perl

by Spickachu (Initiate)
on Jul 27, 2000 at 14:50 UTC ( [id://24653]=perlquestion: print w/replies, xml ) Need Help??

Spickachu has asked for the wisdom of the Perl Monks concerning the following question:

Yeah, so I know that you can't atm, but is there likely to be any module or support for WAP in the furture and passing WML data? Cheers, Stu

Replies are listed 'Best First'.
Re: WML and Perl
by le (Friar) on Jul 27, 2000 at 15:06 UTC
    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?)
(ar0n) Re: WML and Perl
by ar0n (Priest) on Jul 27, 2000 at 15:05 UTC
    There is a subclass of CGI (CGI::WML) for WML output
    here. I also saw a mention of a WAP::WML module,
    but i think that's still being developed.

    -- ar0n

Re: WML and Perl
by Anonymous Monk on Jul 27, 2000 at 17:59 UTC
    There is the CGI::WML module on CPAN which also has a wml2wmlc converter. (All WAP devices are supposed to read compressed WML so bandwidth is conserved.) This will allow you to preconvert the files. Also there is an html2wml converter under development as part of the CGI::WML effort.
      I don't know what wml2wmlc actually does, but WAP devices don't read "compressed" data but "compiled" data. The gateway handles this (get WML page from normal server, compiles it into some kind of bytecode, passes the bytecode to WAP device).

      Knowing the compiled size of your WML pages is a great advance, since devices like WAP phones have limited RAM (a Nokia 7110 gives up on compiled pages over 1400 bytes!).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://24653]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-19 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found