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.

PRIVATE CLASS CONSTANTS

debug

Set to true if you are ....

CONSTRUCTOR (new)

Accepts class reference, returns HTML::Analyse::Docuemnt object, with the following slots:

PUBLIC words

Hash where keys are words encountered, values are number of instances encountered by this object to date, with the added weight (see below).

PRIVATE context_w

Context weight for the word being processed, +/- any changes made in processing.

PRIVATE INPUT

A string of HTML input.

PUBLIC output

A string of HTML output.

PUBLIC METHOD dump

Dumps the contents of $self

PUBLIC METHOD hyperlink

Modify HTML by adding hyperlinks around specified words.

Text to hyperlink should passed as keys of a hash, with relative values being the URLs the links should point to.

Sets the output slot and returns its contents.

PUBLIC METHOD save

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

Returns undef on failure.

SYNOPSIS

use HTML::LinkAdd;
my $instance = new HTML::LinkAdd('input.html');
$instance->hyperlink('the clocks were striking thirteen'=>'footnotes.html#OrwellG-1');
$instance ->save ('output.html');

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 23:

'=item' outside of any '=over'

Around line 31:

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

Around line 35:

'=item' outside of any '=over'

Around line 80:

You forgot a '=back' before '=head2'