Hello List,
I just wrote a little script which should check URLs from the databse if
they are correct.
That works fine. But I wasn't able to tell the script to run with other
environment variables.
The Perl that I use is a custom build of a software system that we use.
Here are the sources of the script:
#!/usr/local/epages5/eproot/Perl/bin/perl
require 5.000;
require Exporter;
@ISA = qw ( Exporter );
use DBI;
use utf8;
use Naturideen::Erweiterung2::API::TLE::MyFormatter;
$| = 0;
#----------------------
# Enter DB-Data
#----------------------
$user1="sa";
$pw1="*****";
$db1="storedb";
$sql1="DBServer";
my $dbi = DBI->connect("dbi:Sybase:server=$sql1;database=$db1",
$user1,$pw1);
my $sql = "SELECT lsa.value, manufacturer,alias FROM product, object,
localizedstringattribute lsa WHERE lsa.languageid = 1 and lsa.objectid =
object.objectid and lsa.attributeid = 1757 and product.productid =
object.objectid and alias = ?";
my $sth = $dbi->prepare($sql);
my $format = new Naturideen::Erweiterung2::API::TLE::MyFormatter;
while(<STDIN>) {
# Fetch the Alias from the URL
/.*-((MA-\d{6})|(\d\d\d\d\d-(\d\d\d?\d?|\w)))/;
# Get the the infos from the database
$sth->execute($1);
my ($name, $manufacturer, $alias) = $sth->fetchrow_array;
my $url = $format->Format(undef, 'sonder', $name,
undef).($format->Format(undef, 'sonder', $name, undef) ne '' ?
'-'.$format->Format(undef, 'sonder', $manufacturer, undef) :
'').'-'.$alias."\n";
if($url eq $_) {
print 'Products/'.$1."\n";
} else {
print '404'."\n";
}
}
$dbi->disonnect;
1;
That works fine.
Here is the conf:
RewriteMap productmap prg:/usr/local/epages5/eproot/Scripts/rewrite.pl
RewriteRule ^/(.*-((MA-\d{6})|(\d\d\d\d\d-(\d\d\d?\d?|\w))))
${productmap:$1}
And here is the error from the apache Log:
Can't locate DBI.pm in @INC (@INC contains:
/home/root-epages-install/Perl/lib/linux
/home/root-epages-install/Perl/lib
/home/root-epages-install/Perl/lib/site_perl/linux
/home/root-epages-install/Perl/lib/site_perl
/home/root-epages-install/Perl/lib/site_perl .) at
/usr/local/epages5/eproot/Scripts/rewrite.pl line 6.
BEGIN failed--compilation aborted at
/usr/local/epages5/eproot/Scripts/rewrite.pl line 6.
Can't locate DBI.pm in @INC (@INC contains:
/home/root-epages-install/Perl/lib/linux
/home/root-epages-install/Perl/lib
/home/root-epages-install/Perl/lib/site_perl/linux
/home/root-epages-install/Perl/lib/site_perl
/home/root-epages-install/Perl/lib/site_perl .) at
/usr/local/epages5/eproot/Scripts/rewrite.pl line 6.
BEGIN failed--compilation aborted at
/usr/local/epages5/eproot/Scripts/rewrite.pl line 6.
In the moment I am trying getting this to work with the native Perl.
Greetings
Manuel
--
HybridWorx - Puxbaumer & Blechschmidt GbR
Manuel Blechschmidt
Julius-Posener-Str. 1
14478 Potsdam
Mobil: 0179/4644688
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]