A number of people have reported a bug where News Clipper says
"NewsClipper.cfg did not return a true value". Attached is another version of
findConfig.pl If you have experienced this problem, could you run this script
like this:
findConfig.pl > output.txt
and send me the results?
Thanks,
David
_________________________________________________________________________
David Coppit
[EMAIL PROTECTED]
President, Spinnaker Software
require 5.004;
use strict;
use vars qw( $home );
# ------------------------------------------------------------------------------
sub CheckConfigLocation
{
print "\n";
foreach my $dir (@INC)
{
print "NewsClipper.cfg found in $dir\n"
if -e "$dir/NewsClipper.cfg";
}
}
# ------------------------------------------------------------------------------
sub LoadConfig
{
$" = "\n";
print "\nStarting \@INC:\n@INC\n";
# Make sure the system-wide configuration directory is on INC, if one is
# specified.
unshift @INC,$ENV{'NEWSCLIPPER'}
if exists $ENV{'NEWSCLIPPER'} && ($^O ne 'MSWin32') && ($^O ne 'dos');
print "\n\$ENV{NEWSCLIPPER} is: $ENV{NEWSCLIPPER}\n";
# Make sure both the system-wide and user-specific configuration directory
# are on INC
unshift @INC,"$home/.NewsClipper";
print "\n\@INC, after adding \$ENV{NEWSCLIPPER} and \$home/.NewsClipper:\n@INC\n";
print "\n\%INC, before loading NewsClipper.cfg:\n";
foreach my $key (sort keys %INC)
{
print "$key => $INC{$key}\n";
}
CheckConfigLocation();
require 'NewsClipper.cfg';
# No error message means we found it
if (!$@)
{
print "\nNewsClipper.cfg loaded as $INC{'NewsClipper.cfg'}\n";
}
else
{
print "\nError while loading NewsClipper.cfg\n";
}
# If there's an error...
if ($@)
{
# Die if we didn't find the config file.
if ($@ =~ /^Can't locate /)
{
print "\nCouldn't find NewsClipper.cfg\n";
}
else
{
print "\nNewsClipper.cfg was found\n";
print " but could not be loaded because of the following error:\n\n$@";
}
}
print "\n\%INC, after loading NewsClipper.cfg:\n";
foreach my $key (sort keys %INC)
{
print "$key => $INC{$key}\n";
}
# Take off the system and user directories now that configuration is loaded
shift @INC
if exists $ENV{'NEWSCLIPPER'} && ($^O ne 'MSWin32') && ($^O ne 'dos');
shift @INC;
print "\n\@INC, after removing \$ENV{NEWSCLIPPER} and \$home/.NewsClipper:\n@INC\n";
}
# ------------------------------------------------------------------------------
# Get the user's home directory. First try the password info, then the
# registry (if it's a Windows machine), then any HOME environment variable.
$home = eval { (getpwuid($>))[7] } || GetWinInstallDir() || $ENV{HOME};
print "\$home is: $home\n";
LoadConfig();
require 'Config.pm';
print "\nPerl information:\n";
print `$Config::Config{perlpath} -v`;
print "\n";
#for my $key (sort keys %Config::Config)
#{
# print "$key => $Config::Config{$key}\n";
#}