I ran into something like that.  I took my needed text and made a module for
it, call it module_to_provide_text. I will paste similar package further
below. I use it in my other modules like this:

use module_to_provide_text;
$text  = "module_to_provide_text"->new;
print ($text->variable_1, "\n");
print ($text->variable_2, "\n");
etc., etc.


------------------------snip module_to_provide_text
#!/usr/bin/perl -w
# file: module_to_provide_text.pm
#########################################################################
package module_to_provide_text;

use strict;

#########################################################################
sub new {
  my ($package) = @_;

  my $class = ref($package) || $package;
  my $self =
      {

        VARIABLE_1                    => "value_1",
        VARIABLE_2                    => "value_2",
        VARIABLE_3                    =>
'
Lots and lots of text
that spans multiple lines
',

        VARIABLE_4                    => "value_4",

     };

  bless($self, $class);
  return ($self);

}

#########################################################################
# Accessor functions
sub variable_1 {
  my $self = shift;
  @_ ? $self->{VARIABLE_1} = shift : $self->{VARIABLE_1};
}

sub variable_2 {
  my $self = shift;
  @_ ? $self->{VARIABLE_2} = shift : $self->{VARIABLE_2};
}

sub variable_3 {
  my $self = shift;
  @_ ? $self->{VARIABLE_3} = shift : $self->{VARIABLE_3};
}

sub variable_4 {
  my $self = shift;
  @_ ? $self->{VARIABLE_4} = shift : $self->{VARIABLE_4};
}
#########################################################################
1;

----- Original Message ----- 
From: "David Greenlee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 27, 2004 8:25 AM
Subject: missing text file


> Hi,
>
> I use FTP::Parser module but this fails with PAR because a data file is
> missing.
>
> Specifically the file FTP/TEXT/ansi is used by FTP/TEXT/Converter.pm
>
> Should/can this small text file be moved to inside the module that uses
> it (perhaps other modules use it as well)? What is the best way for
> module authors to get around this?
> Is there a nice way to add the missing file so that it gets found?
>
> Many thanks, David
>

Reply via email to