NAME

HTML::LinkAdd - add hyperlinks to phrases in HTML documents

DESCRIPTION

A simple object that accepts a class reference, a path to a file, and a hash of text-phrase/link-URLs, and supplies a method to hyperlink the supplied phrases to the supplied URLs, and a method to save the file.

DEPENDENCIES

strict
warning
HTML::TokeParser

CONSTRUCTOR (new)

Accepts class reference, some HTML, and a hash of phrases and hyperlinks. The HTML may be a filename passed as a scalar, or a reference to a scalar thast is literal HTML.

Returns a scalar that is the updated HTML input.

PUBLIC output

A string of HTML output.

PRIVATE INPUT

A string of HTML input.

PUBLIC METHOD hyperlink

Returns the hyperlinked HTML docuemnt constructed by...the constructor.

PUBLIC METHOD save

Saves the object's output slot to filename passed as scalar.

Returns undef on failure, 1 on success.

SYNOPSIS

use HTML::LinkAdd;
my $page = new HTML::LinkAdd('testinput1.html',
	{'the clocks were striking thirteen'=>'footnotes.html#OrwellG-1'}
);
warn $page -> hyperlinked;
$page ->save ('output.html');

CAVEATS

Is only as limited as HTML::TokeParse (see HTML::TokeParse).

TODO

  • Add support for linking images by source or ID.

AUTHOR

Lee Goddard lgoddard@cpan.org 01/05/2001 London, UK

COPYRIGHT

Copyright (C) Lee Goddard. All Rights Reserved. This is free software and you may use, abuse, amend and distribute under the same terms as Perl itself.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 30:

'=item' outside of any '=over'

Around line 85:

You forgot a '=back' before '=head1'

Around line 132:

'=item' outside of any '=over'

Around line 136:

You forgot a '=back' before '=head1'