matth has asked for the wisdom of the Perl Monks concerning the following question:
Hi everybody, I have another question. What, in a nutshell, does the following error message mean (beyond the obvious) and is there an easy way of overcoming this?
bash-2.05$ perl perl_monks_B.pl
XML/Twig.pm did not return a true value at perl_monks_B.pl line 4.
BEGIN failed--compilation aborted at perl_monks_B.pl line 4.
In short, it sounds like you have a bad version of XML::Twig, and you should grab it from CPAN and reinstall it.
The long answer is that perl modules must end with a true value (most modules simply put 1; at the end), but the XML::Twig that you have installed doesn't do that (which leads me to believe that you have a bogus version). For more information on the whole must-return-a-true-value thing, see perldoc perlmod.
"One word of warning: if you meet a bunch of Perl programmers on the bus or something, don't look them in the eye. They've been known to try to convert the young into Perl monks." - Frank Willison
I have re-installed it and with the make test command I get the following output (shortened version)
bash-2.05$ make test
cp Twig.pm blib/lib/XML/Twig.pm
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl
+5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 -e 'use Test::Harness qw(&r
+untests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/is_field..........XML/Twig.pm did not return a true value at t/is_fi
+eld.t line 4.
BEGIN failed--compilation aborted at t/is_field.t line 4.
t/is_field..........dubious
Test returned status 255 (wstat 65280, 0xff00)
t/test1.............XML/Twig.pm did not return a true value at t/test1
+.t line 11.
BEGIN failed--compilation aborted at t/test1.t line 11.
t/test1.............dubious
Test returned status 255 (wstat 65280, 0xff00)
t/test2.............XML/Twig.pm did not return a true value at t/test2
+.t line 10.
BEGIN failed--compilation aborted at t/test2.t line 10.
t/test2.............dubious
Test returned status 255 (wstat 65280, 0xff00)
t/test3.............XML/Twig.pm did not return a true value at t/test3
+.t line 13.
What version is this (try perl -MXML::Twig -l -e'print $XML::TWIG::VERSION')? And how are you installing it? Did you do Perl Makefile.PL? Twig.pm should not be empty, but in any case it is generated from Twig.pm.slow (see Speeding-up OO accessor methods for the reason to this).
The fact that your version of Twig.pm is zero bytes after intallation is definitely suspicious.
I for one would be interested if you posted all of the STDIN/STDOUT/STDERR from your CPAN session. (I'm suspect mirod would be interested too.)
As allways, posting the output of "perl -V" on your system would be useful -- in situations like this where the installation takes divergent paths based on which version of perl you are using, it is ESENTIAL -- in figuring out what is happening.