Turning off "Can't locate ... Apache:..." warning

I am writing mod_perl code via OptiPerl on a XP box running activestate.  The box does not have mod_perl installed.  I have mod_perl installed on a linux box for development and use Optiperl "publish project" to move my MP code from the XP box to the Linux box.  

Optiperl issues a warning in the error window that it cannot find the Apache modules.  Sure, they're not on the XP box.

Is there a way to suppress those include warnings for the Apache:: namespace modules?

See if the use of version converter remarks can help you. See the help file under section "Saving to remote servers" or http://www.xarka.com/optiperl/help/versionconverter.htm

You could also try getting a version of perl that has mod_perl and apache included, so you can run apache and test mod_perl offline. The version of perl we recommend has all this included: http://www.xarka.com/optiperl/support.html

Code Sample
Save this file as C:\perl\site\lib\RemoteModule.pm

package RemoteModule;
Copyright 2004 John Drago <john.drago@e-commedia.com>
This software is free software and may be distributed under the same terms
as perl itself, so long as this copyright notice is included.


                        use RemoteModule "Missing::Module" => "http://some-code-server/Missing/Module.pm";
                        use Missing Module;


use strict;
my %urls = ();

sub import
my ($s) = shift;
my ($class,$url) = @_;
$urls{$class} = $url;
}# end BEGIN{}

push @INC, sub {
my ( $coderef, $filename ) = @_;
$filename =~ s/\//::/g;
$filename =~ s/\.pm$//;
return undef unless defined $urls{$filename};
open my $fh,
"perl "
. " -MHTTP::Request::Common "
. " -MLWP::UserAgent "
. " -e \"print LWP::UserAgent->new->request( "
. " GET '$urls{$filename}' "
. " )->content\" | ";
return $fh; };
}# end BEGIN


Then use remote modules like this:

#!perl -w
use strict;
use RemoteModule "Crypt::RC4" => "http://search.cpan.org/src/SIFUKURT/Crypt-RC4-2.02/RC4.pm";
use Crypt::RC4;
my $crypted = RC4( "secret password!!!", "Text to be encrypted!" );
print "Encrypted: $crypted\n";
print "Decrypted: " . RC4( "secret password!!!", $crypted );

As long as you can find the code on CPAN, you're fine. You can even execute code you download on-the-fly from your remote code source. Works fine for most things, and gets rid of your errors. :)

02.09.2003. 13:54

This article hasn't been commented yet.

Write a comment




8 + 2 =