PHP Code:
#!/usr/bin/perl -w
my $file = "file.xml"; # Replace this with your xml file
my $line = 0;
open(XML, $file);
my @xml = <XML>;
close(XML);
my $a = 1;
foreach $line(@xml) {
if($line =~ m/<link>(.*?)<\/link>/i) {
print "Definition $a\n$1\n";
$a++;
}
}
This outputs
Code:
Definition 1
google.com
Definition 2
state.tn.us
Hope this helps!
Remember to replace the $file variable with the name of your xml file.