AddressBook::DB::HTML - Backend for AddressBook to print entries in HTML format


  use AddressBook;
  $a = AddressBook->new(source => "HTML");


AddressBook::DB::HTML currently supports only the sequential write method.

Behavior can be modified using the following options:


The write_format string is eval'd to determine how the entry is written. The default write_format string is:

  'table(Tr([map{td(["$_:",$attributes{$_}])} keys %attributes]))'

This displays the entry in a table with attribute names on the left and values on the right. As can be seen, tag-generating functions can be used in format strings. The "%attributes" hash is available for use. The keys of %attributes are HTML backend attribute names, and the values are the corresponding attribute values. Specific attributes can also be referenced by name using a scalar with the same name as the attribute. For example,

  'Name: $Name'

Assuming that "Name" is a valid HTML attribute, this format string will display entry names. This is equivalent to:

  'Name: $attributes{Name}'

The HTML backend recognizes the string "keys %attributes", and substitues an expression which ensures that the "order" meta-attribute is obeyed.


The form_format string is eval'd to construct an html entry form. The default form_format string is:

  table(Tr({-valign=>"TOP"},[map{td([$_,$attributes{$_}])} keys %attributes]))

Which generates a table of fields with labels on the left. The input type is based on the attribute type, eg. "text" attributes appear as text input fields, "boolean" attributes appear as checkbox inputs, etc... The default values of the entry fields are the current values of the entry's attributes.


The string to use in joining multiple instances of the same attribute. The default is "<br>"


Mark A. Hershberger, <> David L. Leigh, <>


AddressBook, AddressBook::Config, AddressBook::Entry.