#!/usr/bin/perl # bookmarks2urls.pl - output all the urls in bookmarks (xml) file # Eric Lease Morgan # May 26, 2010 - first investigations; trivial # require use strict; use XML::XPath; # define use constant BOOKMARKS => '/disk01/www/html/main/sandbox/great-books/etc/bookmarks.xml'; # do the work my $parser = XML::XPath->new( filename => BOOKMARKS ); my $anchors = $parser->find( '//A' ); foreach my $anchor ( $anchors->get_nodelist ) { print $anchor->getAttribute( 'HREF' ), "\n"; }