Scott Haneda wrote:
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"); #

This *could* be your problem (I don't have OS X or your code to test it on.) Normally use happens at compile time but your code is use'ing the module at run time. You probably want to run that at compile time in a BEGIN block:

our $CanUseAddress;
BEGIN { $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');

If the module is installed properly that should be:

          $ver = $Email::Valid::VERSION;

$VERSION is a scalar variable, not a method.


        $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 :)



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to