Next: Documentation Previous: Completing the module Contents: Contents |
You may want your converter to provide tags already defined somewhere. It is not necessary to redefine them, which would make it hard to keep all definitions synchronized later. Instead of this, simply load the appropriate modules. As an example, here's the (almost) complete code of PerlPoint::Tags::SDF
. The related converter pp2sdf
does not define a single tag itself - its tag definitions are just a combination of "foreign" tags.
01: # declare package 02: package PerlPoint::Tags::SDF; 03: 04: # declare package version 05: $VERSION=...; 06: 07: # declare base "class" 08: use base qw(PerlPoint::Tags); 09: 10: # set pragmata 11: use strict; 12: 13: # declare tags (reuse definitions made elsewhere) 14: use PerlPoint::Tags::Basic; 15: use PerlPoint::Tags::HTML qw(A L PAGEREF SECTIONREF U XREF); 16: 17: 1; |
This example demonstrates two methods of reusing other definitions. Line 14 loads all definitions made by PerlPoint::Tags::Basic
. Line 15, on the other hand, picks certain definitions made by PerlPoint::Tags::HTML
, the definition file of pp2html
, ignoring all definitions not explicitly listed in the use
statement.
If tags are defined in more than one of the included modules, messages will be displayed warning about duplicated definitions. New definitions overwrite earlier ones, so the last appearing definition of a tag wins.
Next: Documentation Previous: Completing the module Contents: Contents |