I'm using cURL to get the XML file for my Twitter friend's timeline. (API here.)
Currently (though I'd be open for more suggestions) I am using Perl to parse the XML. This is my first time using Perl and I really don't know what I am doing. Currently this is my code:
#!/usr/bin/perl
# use module
use XML::Simple;
use Data::Dumper;
# Create object.
$xml = new XML::Simple;
# Read XML file.
$data = $xml->XMLin("/tmp/data.xml");
# Print output.
print Dumper($data);
Now I want to go through the XML and print out each person's name and then what they tweeted. Currently I have not found a good guide on Perl's foreach loop when there is a complicated data structure like this one.
How can I achieve this?
(Any other ways to parse the XML in a terminal friendly environment would be nice to know about as well)