Hi

(This may be more of an XML-related question than a Perl one, but I would have thought that someone around here could help me out). I would like to pass some parameters to a Perl script via clicking on a link in an RSS feed. The XML file for the RSS feed itself is generated by another Perl script. I can pass the parameters as long as I have just one parameter in the link, but when I try to use two, the "&" sign seems to screw things up. I suspect it might be something to do with the XML header.
Here are the relevant lines from the first Perl script that generates the XML for the RSS feed:

...(snip) $rss_out_file = "/home/foo/bar/public_html/RSS_feed.xml"; (A load of stuff to query our database and write the rows to an array of arrays) open RSSFILE, ">$rss_out_file" or die "Couldn't open RSS feed file: $! +"; print RSSFILE '<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>RSS feed</title> <link>http://(server IP address)/</link> <description>blah blah blah</description>'; foreach $n(@RSStable) { print RSSFILE '<item><title>'.$$n[0].'</title><link>'.$$n[1].'</link>< +description>'.$$n[2].'</description></item>'; } print RSSFILE '</channel></rss>'; close RSSFILE;
Now when the link is something like "http://(server IP address)/other_perl_script.pl?param1="foo"", there is no problem when I click on the link on the feed. However, when the link is "http://(server IP address)/other_perl_script.pl?param1="foo¶m2="bar"", the other perl script does not pick up the second parameter. I know it is not a problem with the other perl script, because I can manually type the URL into the browser and both parameters will be passed OK.

It must therefore be the way the XML is written (I suspect the header), but since I have little experience with XML, I'm not sure what I should be doing.

Can anyone out there help me?

TIA, Campbell


In reply to Passing parameters to a Perl script via an RSS feed by campbell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.