OODoc::Text - text component as found in a manual


   is an OODoc::Object

 OODoc::Text is extended by


 # Cannot be instantiated itself


The parsers (implemented in the OODoc::Parser classes) scan the documentation as written down by the author of the module, and build a tree of these OODoc::Text objects from it. Then, any formatter (implemented by the OODoc::Format classes) can take this tree of text objects and convert it into manual pages.

Extends "DESCRIPTION" in OODoc::Object.


Extends "OVERLOADED" in OODoc::Object.

overload: '""' <$stringification>

Returned is the name of the text object.

overload: '==' $and '!='

Numeric comparison is used to compare to objects whether they are identical. String comparison is overloaded to compare the names of the objects.

overload: 'cmp' <$string $comparison>

Names are compared.


Extends "METHODS" in OODoc::Object.


Extends "Constructors" in OODoc::Object.

 -Option     --Default
  container    <required>
  description  ''
  linenr       <required>
  name         undef
  type         <required>
container => OBJECT

All text objects except chapters are contained in some other object.

description => STRING

The text which is contained in the body of this text item. Often, this is filled in later by openDescription().

linenr => INTEGER
name => STRING

The name contains the main data about the text piece.

type => STRING

The type of this text element. This is used for debugging only.

Inheritance knowledge

Extends "Inheritance knowledge" in OODoc::Object.

$obj->extends( [$object] )

Inherited, see "Inheritance knowledge" in OODoc::Object


$obj->container( [$object] )

The text element which encapsulates the text element at hand. This defines the structure of the documentation. Only for chapters, this value will be undefined.


Returns the description text for this object. Nearly all objects contains some kind of introductory description.


The name of this text element. Stringification is overloaded to call this name method.


 print $text->name;
 print $text;   # via overload

Returns the type name of this data object.


$obj->manual( [$name] )

Without a $name, the manual of the text object is returned. With a $name, the manual with that name is returned, even when that does not have a relation to the object: it calls OODoc::Object::manual().


Returns a unique id for this text item. This is the easiest way to see whether two references to the same (overloaded) objects point to the same thing. The ids are numeric.


 if($obj1->unique == $obj2->unique) {...}
 if($obj1 == $obj2) {...}   # same via overload

Returns the source of the text item: the filename name and the line number of the start of it.



Add a new example (a OODoc::Text::Example object) to the list already in this object. You can not look for a specific because they have no real name (only a sequence number).


Returns a list of all examples contained in this text element.


From the current object, search in the extends until an object is found which has a content for the description field.


Returns a reference to the scalar which will contain the description for this object.


 my $descr = $text->openDescription;
 $$descr  .= "add a line\n";

Commonly used functions

Extends "Commonly used functions" in OODoc::Object.


Inherited, see "Commonly used functions" in OODoc::Object


Inherited, see "Commonly used functions" in OODoc::Object

Manual Repository

Extends "Manual Repository" in OODoc::Object.


Inherited, see "Manual Repository" in OODoc::Object


Inherited, see "Manual Repository" in OODoc::Object


Inherited, see "Manual Repository" in OODoc::Object


Inherited, see "Manual Repository" in OODoc::Object


Inherited, see "Manual Repository" in OODoc::Object


Error: manual definition requires manual object

A call to addManual() expects a new manual object (a OODoc::Manual), however an incompatible thing was passed. Usually, intended was a call to manualsForPackage() or mainManual().

Error: no text container specified for the $type object

Each text element is encapsulated by an other text element, except chapters. A value must be known for this container option to define the elements relative location.


This module is part of OODoc distribution version 2.02, built on December 08, 2021. Website:


Copyrights 2003-2021 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the Artistic license. See