On Jan 23, 2009, at 1:01 AM, Gunnar Hjalmarsson wrote:
Scott Haneda wrote:
ASSP required about 15 perl modules, I installed them, or wrote new
portfiles for them to get them installed. I have all requirements
for ASSP installed. I edit the ASSP source files to change the
first line from:
#!/usr/bin/perl --
to
#!/opt/local/bin/perl --
When I run ASSP, it tells me three ports are not installed. One is
Email::Valid, which should serve well enough as a way for me to
learn how to solve this.
Try running:
/usr/bin/perl -MEmail::Valid -e 'print $INC{"Email/Valid.pm"}'
$/usr/bin/perl -MEmail::Valid -e 'print $INC{"Email/Valid.pm"}'
Can't locate Email/Valid.pm in @INC (@INC contains: /System/Library/
Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /
Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /
Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /
Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/
Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/
5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1 .).
BEGIN failed--compilation aborted.
and
/opt/local/bin/perl -MEmail::Valid -e 'print $INC{"Email/Valid.pm"}'
$/opt/local/bin/perl -MEmail::Valid -e 'print $INC{"Email/Valid.pm"}'
/opt/local/lib/perl5/vendor_perl/5.8.9/Email/Valid.pm
and let us know the results.
I am not entirely sure what that all means, but I think it is telling
me there is in fact no Email::Valid in the default install, but there
is one in the /opt/local/bin/perl one.
Looking through the source of ASSP, I see this one line
[start snip of all the other modules]
our $CanUseAddress = eval("use Email::Valid; 1"); #
Email Valid module installed
[end snip of all the other modules]
A bit down later in the source:
if ($CanUseAddress) {
$ver = eval('Email::Valid->VERSION');
$VerEmailValid = $ver;
$ver = " version $ver" if $ver;
mlog( 0, "email::Valid module$ver installed and available" );
} else {
mlog( 0, "email::Valid module not installed" )
if $DoRFC822 || $DoDomainCheck;
}
So I am falling into the else here, there is a chance it is installed,
and this code is simply reporting it wrong. Don't kill me, this now
makes it 58 lines of perl in my life :)
#!/opt/local/bin/perl --
use strict;
our $CanUseAddress = eval("use Email::Valid; 1");
if ($CanUseAddress) {
print "true\n";
} else {
print "false\n";
}
When I run that, I get *true*
when I run it with #!/usr/bin/perl -- I get *false*
So my local base test code, works as advertised; it is when I run it
from the assp.pl ASSP program, that I am getting into trouble. About
the only next logical troubleshooting steps I could take would be to
add in the ASSP source's "use" statements.
use strict qw(vars subs);
use bytes; # get rid of annoying 'Malformed UTF-8' messages
use Encode;
use File::Copy;
use IO::Select;
use IO::Socket;
use Sys::Hostname;
use Time::Local;
use vars qw(@ISA @EXPORT);
I added those in, I still get *true*. Looking over the entire source
directory, and searching for "$CanUseAddress" I see it used three
times, and only one of which is a set to a variable, the other are
conditionals, so I can not see the value getting stepped on.
Stumped... I am browsing the source, it is a large file, a bit tough
for me to jump into.
Thanks for looking this over with me.
--
Scott
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/