[ic] posttourl.tag

Grant listbox at email.com
Thu Aug 28 10:30:41 EDT 2003


> You're using a comma (,) where you should be using a dot (.) on the
> three "$page .=" lines, at the end of the sub.


Thanks Kevin.  After fixing that I was able to get IC to restart without
displaying an error about the tag.  With a little trial and error I think
I've discovered why I've been having trouble with the tag.  I need to be
able to pass certain headers to the URL that I'm posting to via HTTP, and
the header titles all have dashes in them.  They're like this:


IC doesn't seem to like that at all.  I get an error like the following when
restarting IC with just one line like the above in the tag:

Useless use of subtraction (-) in void context at (eval 74) line 15,
<SYSTAG> line 28.

For context, here's the whole tag Kevin posted:

    Usertag posttourl Order url params
    Usertag posttourl Routine <<EOR
    use HTTP::Request;
    use HTTP::Headers;
    use LWP::UserAgent;
    sub {
        my ($url,$params) = @_;

        local($ENV{'HTTPS_VERSION'}) = '3';
        local($ENV{'HTTPS_CERT_FILE'}) = 'xxx.pem';
        local($ENV{'HTTPS_KEY_FILE'}) = 'xxx.key';

        my $request = new HTTP::Request('POST' => $url);

        my $ua = new LWP::UserAgent;
        my $response = $ua->request($request);

        my $page = $response->as_string() . "\n\n\n";
        $page .= $response->code() . "\n";
        $page .= $response->message() . "\n";

        return $page;

I have three ideas for a solution.  Please tell me what you guys think as
far as their feasibility.

1. Is there another character other than "-" that can be substituted in its
place and still be read correctly, or does that depend on the reader?

2. Change the usertag somehow so it's OK with dashes.

3. Have the headers passed to the tag from the tag's call.

What do you think?

- Grant

More information about the interchange-users mailing list