in reply to Unitialized value and splice offset in RTF::Document
Your first issue is that $self->{charset} is undefined as this is the only concatenation happening. The real issue is why it is undefined? The splice warning indicates that $self->{DOCUMENT} is either undef or a zero element array.
The problem is the name of the import() sub itself. When you use a module Perl will call that modules import() function if it exists or Exporter's import() function if Exporter is in use (Exporter is uselessly used in this module BTW)
In the new function() we can see:
$self->initialize(); $self->import(@_);
This is fine as initialize() will define {charset} and {DOCUMENT}, before the call to import(). The issue is that import() is called immediately you use RTF::Document, so it gets called before you call new. You can fix the problem with a simple s/import/important_not_to_call_stuff_import/g or similar.
As an asside this module has not been touched since 2000 so is probably abandonware. If you have an interest it might be worth taking over maintenance. There are also modules like RTF::Writer that seem better maintained. If you do take over maintenance then please delete these redundant lines at the top of the module:
require Exporter; .... @ISA = qw(Exporter); @EXPORT = qw(); @EXPORT_OK = qw();
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unitialized value and splice offset in RTF::Document
by inblosam (Monk) on Sep 01, 2004 at 12:02 UTC |