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

How do you parse wml form parameters using CGI::WML The only way i can do it just now is by hacking the query string. Is there no param method in CGI::WML. Anyone know any good WAP docs? I have a wml form as below
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapfo +rum.org/DTD/wml_1.1.xml"> <wml> <card id="main" title="Wap-Uk.com"> <do type="accept" label="Submit"> <go method="post" href="/cgi-bin/wap/test.cgi?user=$(username)&p +ass=$(password)"> </go> </do> <p> Please enter your username: <input type="text" name="username"/> </p> <p> Please enter your password: <input type="password" name="password"/> </p> </card> </wml>
and currently perl code
use CGI::WML; my $q = new CGI::WML; #param call no working #my username=$q->param(username); #use query string instead my $qStr = $ENV{'QUERY_STRING'};

Replies are listed 'Best First'.
(jeffa) Re: WML parameters -WAP it out
by jeffa (Bishop) on Feb 27, 2002 at 15:53 UTC
    Hmmmm .... what's the problem?
    use CGI::WML; my $q = new CGI::WML; print $q->param('foo'), "\n"; # results: [jeffa@trinity cgi-bin]$ ./wml.cgi foo=bar bar
    UPDATE:
    Be sure and wrap the param username in quotes:
    param('username')
    Not doing so only issues a warning however ... the param should still be fetched.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Discovered two problems, I had not set Apache AddType .wml I also discovered that I can use the standard CGI module to get the params. Cheers anyhow