does work. I had updated incorrectly the XML file, thankyou for that.#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; use LWP::Simple; my $Document =XMLin("foo.xml"); while (my ($key, $val) = each %{$Document->{Placemark}}) { printf "%s is at %s\n", $key, $val->{Point}{coordinates}; }
Now that I can get the info from an XML file stored locally I tried to get the file when stored on a web server.
I used this script but it says that the file does not exist!
Any clues?
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; use LWP::Simple; use XML::Parser; my $url= "http://xweb.geos.ed.ac.uk/~s0341330/foo.xml"; my $foo = get ($url) or die "I can't get the feed you want"; my $parser = XML::Simple->new( ); my $Document =$parser->XMLin('$foo'); while (my ($key, $val) = each %{$Document->{Placemark}}) { printf "%s is at %s\n", $key, $val->{Point}{coordinates}; }
Many thanks
Niall
In reply to Re^4: XML::Simple troubles
by carterniall
in thread XML::Simple troubles
by carterniall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |