[prog] web programming with perl

Shuying Wang shuying at gmail.com
Mon May 2 22:51:24 EST 2005


Hi,

I'm actually refering the <%args> block. I'm trying to use request
tracker's (3.4.1) REST interface except I don't know how to form the
uri to pass to the script.  So basically, what I'm trying to do, is to
formulate a URL that Mason can parse. I'm pasting the relevant parts
of the script below:
<%ARGS>
$id
$changes => {}
</%ARGS>
my %data = %$changes;
....
    if (%data == 0) {
        return [
            "# Required: Name",
            [ "id", @fields ],
            {
                id => 'queue/new',
                Name => '<queue name>',
                ...
            },
            0
        ];
    }
...
I  had a look at the mason docs and it suggests that to pass in a
hash, the url would look something like this:
/url/to/component?grades=Sue&grades=99&grades=Tom&grades=98
which would be translated to :
%grades => ('Sue'=>99, 'Tom'=>98)
Whereas the code above looks like it's a reference to a hash rather
than a hash.
I'm not sure if I'm missing something or if that bit of the request
tracker code doesn't work.

Jacinta, thanks for the advice and the book link. I was really
impressed by your response.

Cheers,
Shuying

On 5/2/05, Jacinta Richardson <jarich at perltraining.com.au> wrote:
> Shuying Wang wrote:
> > A Perl CGI program I'm extending uses Mason and one of the required
> > bits to the <%ARGS> is a hash $changes=>{}. Could anyone tell me how I
> > can pass arguments as a hash to it? I know the basic URL should be
> > something like http://someserver/scriptx/component/new?key=value but I
> > can't find any information on passing data structures in.
> I was wondering whether you could give more information.  When you refer to
> <%ARGS> are you referred to the <%args> block, or the %ARGS hash?


More information about the Programming mailing list