I want a perl cgi script to read a URL from an XML file and then redirect to 
it.

The use statements I have are:
  use CGI;                            # For http interacton
  use XML::XPath;
  use XML::XPath::XMLParser;

   print $q->redirect($homepage);
works if I have files the $homepage variable directly with a double quoted 
string of my own.
It does not work if I fill the string using
  my $xp = XML::XPath->new(filename => $file);
  my $homepage = $xp->findvalue("//URL");

I have also tried getting the URL value using
  my $nodeset = $xp->find('//URL');
  foreach my $node ($nodeset->get_nodelist) {
    $homepage = XML::XPath::XMLParser::as_string($node);
  }
and stripping off the surrounding XML tags.

Could anyone help?
Thank you,
Tammy Ernst

Reply via email to