Visitor - a sample Visitor object for Netscape bookmarks
use Netscape::Bookmarks; use Visitor; my $netscape = Netscape::Bookmarks->new( 'Bookmarks.html' ); my $visitor = Visitor->new(); my $netscape->introduce( $visitor );
This class is an example Visitor class for Netscape::Bookmarks. It dispatches the visit to a method depending on what sort of object it visits. For all objects, a short message is output to standard output. For a link object, it calls in HTTP::SimpleLinkChecker if you have it and then checks the link.
You can use this as a starting point for your own Visitor.
No big whoop. It simply creates an uninteresting object that knows it's class so we can dispatch with it.
The Netscape::AcceptVisitors module requires this method. Use visit() to dispatch a visit to the right method. How you do that is up to you.
Beyond that, look at the code.
brian d foy <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright © 2004-2015, brian d foy <bdfoy@cpan.org>. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Netscape::Bookmarks, Netscape::Bookmarks::AcceptVisitor
To install Netscape::Bookmarks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Netscape::Bookmarks
CPAN shell
perl -MCPAN -e shell install Netscape::Bookmarks
For more information on module installation, please visit the detailed CPAN module installation guide.