NAME

Text::Annotated::Line - strings with annotation about their origin

SYNOPSIS

 use Text::Annotated::Line;

 # construct a line
 $line = new Text::Annotated::Line(
      filename => 'foo', 
      linenr   => 23,
      content  => 'This is the line content',
 );

 # print the line, with annotation
 print $line->stringify_annotated, "\n";

 # print the line without annotation
 print $line, "\n";

DESCRIPTION

FIELDS

All of the following fields must be set through the constructor new():

filename

name of the file the string originates from

linenr

number of the line in the file the string is located

content

the actual content of the string

METHODS

new()

Constructs a new Text::Annotated::Line object. Fields can be set by passing them as a hash to new().

stringify()

Returns the line without annotations. This method is used for overloading, so you implicitly call it in any circumstance where you use a Text::Annotated::Line object where a string is expected.

stringify_annotated()

Returns a string with the content AND the annotation if the format [filename#linenr]content. Trailing newlines in the content are omitted.

SEE ALSO

Filters for handling annotated lines are described in Text::Annotated::Reader and Text::Annotated::Writer.

CVS VERSION

This is CVS version $Revision: 1.5 $, last updated at $Date: 2002/08/13 16:17:11 $.

AUTHOR

Wim Verhaegen <wim.verhaegen@ieee.org>

COPYRIGHT

Copyright (c) 2000-2002 Wim Verhaegen. All rights reserved. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself.