in reply to Re^2: XML::Simple troubles
in thread XML::Simple troubles
Am I correct in saying that % denotes a hash as opposed to @ denoting an array?
Yes. See perldsc, perlreftut, perlref and perldata for details.
Maybe you want something along these lines:
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; my $Document =XMLin("foo.xml"); while (my ($key, $val) = each %{$Document->{Placemark}}){ printf "%s is at %s\n", $key, $val->{Point}{coordinates}; } __END__ Abbeyhill is at -3.17075,55.95705,0 Abbey Strand is at -3.17423,55.95277,0 Abbeymount is at -3.1723,55.95524,0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: XML::Simple troubles
by carterniall (Novice) on May 27, 2008 at 08:18 UTC | |
by moritz (Cardinal) on May 27, 2008 at 09:13 UTC | |
|
Re^4: XML::Simple troubles
by carterniall (Novice) on May 26, 2008 at 12:17 UTC | |
by moritz (Cardinal) on May 26, 2008 at 12:29 UTC | |
by Corion (Patriarch) on May 26, 2008 at 12:35 UTC |