Bug 1466 - Can't Locate object method "new" via package "Pod::Text"
Summary: Can't Locate object method "new" via package "Pod::Text"
Status: RESOLVED WORKSFORME
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Sun Linux
: P2 major
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL: http://www.timesliceinc.com
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-10 08:45 UTC by Black3000
Modified: 2003-02-10 02:41 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Black3000 2003-02-10 08:45:43 UTC
Trying to install latest release of SpamAssassin-2.44 on Sun Cobalt RAQ4 for 
first time. Have attempted both the CPAN shell install and manual tar.gz unzip 
process. No success due to below referenced errors. 

/urs/bin/pod2text
-r-xr-xr-x   1 root     root         7877 Feb  9 21:50 pod2text
line 72 from /usr/bin/pod2text reads: (See complete code below)
# Initialize and run the formatter.
my $parser = $formatter->new (%options);
$parser->parse_from_file (@ARGV);


[root /tmp]# cd Mail-SpamAssassin-2.44
[root Mail-SpamAssassin-2.44]# perl Makefile.PL
Writing Makefile for Mail::SpamAssassin
[root Mail-SpamAssassin-2.44]# make
for f in spamassassin spamd/spamc.pod spamd/spamd lib/Mail/SpamAssassin.pm 
lib/Mail/SpamAssassin/Conf.pm lib/Mail/SpamAssassin/PerMsgStatus.pm 
lib/Mail/SpamAssassin/PersistentAddrList.pm  ; do \
      echo Converting POD in $f; \
      pod2html $f > doc/`echo $f | /usr/bin/perl -pe \
        's,^(lib|spamd)/|\.(pod|pm)$,,g; tr,/,_,;'`.html ; \
      pod2text $f > doc/`echo $f | /usr/bin/perl -pe \
        's,^(lib|spamd)/|\.(pod|pm)$,,g; tr,/,_,;'`.txt ; \
done
Converting POD in spamassassin
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in spamd/spamc.pod
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in spamd/spamd
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in lib/Mail/SpamAssassin.pm
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in lib/Mail/SpamAssassin/Conf.pm
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in lib/Mail/SpamAssassin/PerMsgStatus.pm
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
Converting POD in lib/Mail/SpamAssassin/PersistentAddrList.pm
Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
line 72.
make: *** [doc/.made] Error 255
[root Mail-SpamAssassin-2.44]#


/urs/bin/pod2text - Complete Code
#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell
    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
        if $running_under_some_shell;

# pod2text -- Convert POD data to formatted ASCII text.
#
# Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
#
# The driver script for Pod::Text, Pod::Text::Termcap, and Pod::Text::Color,
# invoked by perldoc -t among other things.

require 5.004;

use Getopt::Long qw(GetOptions);
use Pod::Text ();
use Pod::Usage qw(pod2usage);

use strict;

# Silence -w warnings.
use vars qw($running_under_some_shell);

# Take an initial pass through our options, looking for one of the form
# -<number>.  We turn that into -w <number> for compatibility with the
# original pod2text script.
for (my $i = 0; $i < @ARGV; $i++) {
    last if $ARGV[$i] =~ /^--$/;
    if ($ARGV[$i] =~ /^-(\d+)$/) {
        splice (@ARGV, $i++, 1, '-w', $1);
    }
}

# Insert -- into @ARGV before any single dash argument to hide it from
# Getopt::Long; we want to interpret it as meaning stdin (which Pod::Parser
# does correctly).
my $stdin;
@ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;

# Parse our options.  Use the same names as Pod::Text for simplicity, and
# default to sentence boundaries turned off for compatibility.
my %options;
$options{sentence} = 0;
Getopt::Long::config ('bundling');
GetOptions (\%options, 'alt|a', 'code', 'color|c', 'help|h', 'indent|i=i',
            'loose|l', 'margin|left-margin|m=i', 'overstrike|o',
            'quotes|q=s', 'sentence|s', 'termcap|t', 'width|w=i') or exit 1;
pod2usage (1) if $options{help};

# Figure out what formatter we're going to use.  -c overrides -t.
my $formatter = 'Pod::Text';
if ($options{color}) {
    $formatter = 'Pod::Text::Color';
    eval { require Term::ANSIColor };
    if ($@) { die "-c (--color) requires Term::ANSIColor be installed\n" }
    require Pod::Text::Color;
} elsif ($options{termcap}) {
    $formatter = 'Pod::Text::Termcap';
    require Pod::Text::Termcap;
} elsif ($options{overstrike}) {
    $formatter = 'Pod::Text::Overstrike';
    require Pod::Text::Overstrike;
}
delete @options{'color', 'termcap', 'overstrike'};

# Initialize and run the formatter.
my $parser = $formatter->new (%options);
$parser->parse_from_file (@ARGV);

__END__

=head1 NAME

pod2text - Convert POD data to formatted ASCII text

=head1 SYNOPSIS

pod2text [B<-aclost>] [B<--code>] [B<-i> I<indent>] S<[B<-q> I<quotes>]>
S<[B<-w> I<width>]> [I<input> [I<output>]]

pod2text B<-h>

=head1 DESCRIPTION

B<pod2text> is a front-end for Pod::Text and its subclasses.  It uses them
to generate formatted ASCII text from POD source.  It can optionally use
either termcap sequences or ANSI color escape sequences to format the text.

I<input> is the file to read for POD source (the POD can be embedded in
code).  If I<input> isn't given, it defaults to STDIN.  I<output>, if given,
is the file to which to write the formatted output.  If I<output> isn't
given, the formatted output is written to STDOUT.

=head1 OPTIONS

=over 4

=item B<-a>, B<--alt>

Use an alternate output format that, among other things, uses a different
heading style and marks C<=item> entries with a colon in the left margin.

=item B<--code>

Include any non-POD text from the input file in the output as well.  Useful
for viewing code documented with POD blocks with the POD rendered and the
code left intact.

=item B<-c>, B<--color>

Format the output with ANSI color escape sequences.  Using this option
requires that Term::ANSIColor be installed on your system.

=item B<-i> I<indent>, B<--indent=>I<indent>

Set the number of spaces to indent regular text, and the default indentation
for C<=over> blocks.  Defaults to 4 spaces if this option isn't given.

=item B<-h>, B<--help>

Print out usage information and exit.

=item B<-l>, B<--loose>

Print a blank line after a C<=head1> heading.  Normally, no blank line is
printed after C<=head1>, although one is still printed after C<=head2>,
because this is the expected formatting for manual pages; if you're
formatting arbitrary text documents, using this option is recommended.

=item B<-m> I<width>, B<--left-margin>=I<width>, B<--margin>=I<width>

The width of the left margin in spaces.  Defaults to 0.  This is the margin
for all text, including headings, not the amount by which regular text is
indented; for the latter, see B<-i> option.

=item B<-o>, B<--overstrike>

Format the output with overstruck printing.  Bold text is rendered as
character, backspace, character.  Italics and file names are rendered as
underscore, backspace, character.  Many pagers, such as B<less>, know how
to convert this to bold or underlined text.

=item B<-q> I<quotes>, B<--quotes>=I<quotes>

Sets the quote marks used to surround CE<lt>> text to I<quotes>.  If
I<quotes> is a single character, it is used as both the left and right
quote; if I<quotes> is two characters, the first character is used as the
left quote and the second as the right quoted; and if I<quotes> is four
characters, the first two are used as the left quote and the second two as
the right quote.

I<quotes> may also be set to the special value C<none>, in which case no
quote marks are added around CE<lt>> text.

=item B<-s>, B<--sentence>

Assume each sentence ends with two spaces and try to preserve that spacing.
Without this option, all consecutive whitespace in non-verbatim paragraphs
is compressed into a single space.

=item B<-t>, B<--termcap>

Try to determine the width of the screen and the bold and underline
sequences for the terminal from termcap, and use that information in
formatting the output.  Output will be wrapped at two columns less than the
width of your terminal device.  Using this option requires that your system
have a termcap file somewhere where Term::Cap can find it and requires that
your system support termios.  With this option, the output of B<pod2text>
will contain terminal control sequences for your current terminal type.

=item B<-w>, B<--width=>I<width>, B<->I<width>

The column at which to wrap text on the right-hand side.  Defaults to 76,
unless B<-t> is given, in which case it's two columns less than the width of
your terminal device.

=back

=head1 DIAGNOSTICS

If B<pod2text> fails with errors, see L<Pod::Text> and L<Pod::Parser> for
information about what those errors might mean.  Internally, it can also
produce the following diagnostics:

=over 4

=item -c (--color) requires Term::ANSIColor be installed

(F) B<-c> or B<--color> were given, but Term::ANSIColor could not be
loaded.

=item Unknown option: %s

(F) An unknown command line option was given.

=back

In addition, other L<Getopt::Long|Getopt::Long> error messages may result
from invalid command-line options.

=head1 ENVIRONMENT

=over 4

=item COLUMNS

If B<-t> is given, B<pod2text> will take the current width of your screen
from this environment variable, if available.  It overrides terminal width
information in TERMCAP.

=item TERMCAP

If B<-t> is given, B<pod2text> will use the contents of this environment
variable if available to determine the correct formatting sequences for your
current terminal device.

=back

=head1 SEE ALSO

L<Pod::Text>, L<Pod::Text::Color>, L<Pod::Text::Overstrike>,
L<Pod::Text::Termcap>, L<Pod::Parser>

The current version of this script is always available from its web site at
L<http://www.eyrie.org/~eagle/software/podlators/>.  It is also part of the
Perl core distribution as of 5.6.0.

=head1 AUTHOR

Russ Allbery <rra@stanford.edu>.

=head1 COPYRIGHT AND LICENSE

Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>.

This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.

=cut
Comment 1 Theo Van Dinter 2003-02-10 08:48:58 UTC
Subject: Re: [SAdev]  New: Can't Locate object method "new" via package "Pod::Text"

On Mon, Feb 10, 2003 at 08:45:44AM -0800, bugzilla-daemon@hughes-family.org wrote:
> Can't locate object method "new" via package "Pod::Text" at /usr/bin/pod2text 
> line 72.
> 
> /urs/bin/pod2text - Complete Code

Pod::Text is not "pod2text".  One's a module, one's a script.  It looks
as if you have an issue with the module.

Comment 2 Theo Van Dinter 2003-02-10 08:50:30 UTC
and actually since it's "pod2text" having the problem, I'm closing the bug as it's not an SA issue.
Comment 3 Black3000 2003-02-10 11:00:21 UTC
NOT RESOLVED:

I realize this is "Freeware" software. And thats a good thing, because based on 
teh reply I just received, there is no way one would pay for this product.

I have found more than 100 various threads on this issue that date back as far 
as August 2002. So apprently I am not the only person who has encountered this 
obvious "BUG!!!!!".

One would only expect that given the magnitude of other users have the same 
issues that one would have posted a FAG report and Action/Resolution Report to 
assist those who likely in the future will encounter this very same "BUG!!!!!"

The fact remains. If SA is depending on other Perl Modules and Scripts that are 
not in its Controls then the Developers of this application need to be 
less "Lets pass the buck on this one" and more proactive in identifying the 
issue, knowing very well that others are experiencing and will continue to 
experience the very same issue unless an alternative installation and 
prerequisite install process is clearly defined for the particular platform in 
question and at error.

Thank you.
Comment 4 John Peacock 2003-02-10 11:22:58 UTC
In all fairness, this is clearly not SpamAssassin's fault.  The version of
Pod::Text which you have installed is not compatible with the version of
pod2text which you have installed.  You can thank Sun for not shipping a newer
Perl with the RAQ4 boxes.  If you feel very brave, you can try and upgrade to a
newer version of POD::Text, but this could cause problems with the Cobalt
reporting tools.

This should be closed as WONTFIX because it is the reporter's system which is
busted and that is nothing that the SpamAssassin developers have any control over.

If you want a workaround, feel free to comment out the pod2text line from the
Makefile.  It is a harmless error that you cannot build the text version of the
POD's.
Comment 5 Theo Van Dinter 2003-02-10 11:28:05 UTC
On Mon, Feb 10, 2003 at 11:00:21AM -0800, bugzilla-daemon@hughes-family.org wrote:
> I realize this is "Freeware" software. And thats a good thing, because based on 
> teh reply I just received, there is no way one would pay for this product.

Good for you.

> The fact remains. If SA is depending on other Perl Modules and Scripts that are 
> not in its Controls then the Developers of this application need to be 
> less "Lets pass the buck on this one" and more proactive in identifying the 
> issue, knowing very well that others are experiencing and will continue to 
> experience the very same issue unless an alternative installation and 
> prerequisite install process is clearly defined for the particular platform in 
> question and at error.

Well, there's a pre-requisite for installing SA: a working perl
installation.  You apparently don't have that, or at least not a
completely working installation, so we can't help you.  Fix the
prerequisite, and things will work better for you.

As for support -- you'll find that if you buy, say, Oracle, and don't
have all the known pre-requisites installed and working, they're not
going to help you either.

Perhaps my response was a little short.  Perhaps it's because I'm not feeling well and am busy with work for my day job ...

Whatever the situation though, the answer is the same: your perl installation doesn't seem to be working.  Since perl is outside the realm of SpamAssassin, it's not a bug in SpamAssassin, so the ticket gets closed.  You may want to ask folks on the spamassassin-talk list.  There were some folks running SA on RAQ machines.  I seem to remember they had problems due to oddities in the perl installation, but I don't know what they did to fix it.

Closing as WFM.
Comment 6 Black3000 2003-02-10 11:41:20 UTC
That's my point! You acknowledge a known install issue on RAQs, therefore, you 
and/or your asscociates should have made it your business to find out exactly 
what the cause and solution was so that fix or workaround could notes could 
have been attached to the distribution that is available from both the SA 
website and CPAN.

FOR The record I have tried to install both the CPAN and SA tar's with the same 
results.
Comment 7 Tony L. Svanstrom 2003-02-10 12:11:33 UTC
Subject: Re: [SAdev]  Can't Locate object method "new" via package
 "Pod::Text"

On Mon, 10 Feb 2003 the voices made bugzilla-daemon@hughes-family.org write:

> ------- Additional Comments From slice_time@hotmail.com  2003-02-10 11:41 -------
> That's my point! You acknowledge a known install issue on RAQs, therefore, you
> and/or your asscociates should have made it your business to find out exactly
> what the cause and solution was so that fix or workaround could notes could
> have been attached to the distribution that is available from both the SA
> website and CPAN.

 Did you completely miss that SA is free software that people are writing and
sharing without getting paid to do so, and that it's targeted at people that
know how to install perl-related software?

 If you need support/help installing/setting up SA then I'm sure there are lots
of people/companies available that wouldn't mind letting you pay them for doing
it for you; that way you don't have to learn how to set up this free software
yourself, great, huh?! =)


Comment 8 Tony L. Svanstrom 2003-02-10 12:19:35 UTC
Subject: Re: [SAdev]  Can't Locate object method "new" via package
 "Pod::Text"

> ------- Additional Comments From felicity@kluge.net  2003-02-10 11:28 -------

> Whatever the situation though, the answer is the same: your perl installation
> doesn't seem to be working.  Since perl is outside the realm of SpamAssassin,
> it's not a bug in SpamAssassin, so the ticket gets closed.  You may want to
> ask folks on the spamassassin-talk list.  There were some folks running SA on
> RAQ machines.  I seem to remember they had problems due to oddities in the
> perl installation, but I don't know what they did to fix it.

 I had a RAQ problem related to how to upgrade perl without breaking all the
GUI-stuff, which seemed to require modules that simply weren't there when I did
a clean (ie in a different location) installation of perl...

 I didn't really have the time to try to solve a problem I easily could avoid,
so I just installed SA on a freeBSD-based server, which the e-mails had to pass
through anyways.