NAME

Alvis::Document::Links - Perl extension for representing links occurring in documents.

SYNOPSIS

 use Alvis::Document::Links;

 # Create a new instance
 my $l=Alvis::Document::Links->new();
 if (!defined($l))
 {
    die('Ugh!');
 }

 if (!$links->add($url,$anchor_txt,$type))
 {
    die("Faulty link information: " . $links->errmsg());
 }

 for my $link ($links->get())
 {
    my ($url,$anchor_text,$type)=@$link;
    # Do something with the link 
 }

DESCRIPTION

A module for link information.

METHODS

new()

Returns a new instance.

add($url,$anchor_txt,$type)

Adds a new link. $url and $type are mandatory.

get()

Returns all links as ([<url>,<anchor text>,<type>], [<url>,<anchor text>,<type>],...) If there is no <anchor text>, it is undef.

errmsg()

Returns a stack of error messages, if any. Empty string otherwise.

SEE ALSO

Alvis::Document

AUTHOR

Kimmo Valtonen, <kimmo.valtonen@hiit.fi>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Kimmo Valtonen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.