Hi Ilya,

The first think that I made was to run the script with perl, and it worked
fine.

The script is very simple, only for tests:

#!/usr/bin/perl

use CGI qw(:standard);
use DBI qw(:connect);

print header;

  my $db1 = DBI->connect("DBI:mysql:XXXXX", "XXXXX", "XXXXX");
  my $sql = "SHOW tables;";
  my $tarefa = $db1->prepare($sql);
   $tarefa->execute();
      while ($saida  = $tarefa -> fetchrow_array){
  print $saida."\n";
   }
 $tarefa -> finish();
 $db1->disconnect;
 exit(0);

Where I omitted the database,user and password.

Thanks
Roberto

----- Original Message -----
From: "Sterin, Ilya" <[EMAIL PROTECTED]>
To: "Roberto Slepetys Ferreira" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 6:41 PM
Subject: RE: PERLCC and DBI


> Well did you use DBI?  Try to run script with interpreter to see if that
> works first.
>
> Ilya Sterin
>
> -----Original Message-----
> From: Roberto Slepetys Ferreira [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 5:28 PM
> To: [EMAIL PROTECTED]
> Subject: PERLCC and DBI
>
>
> Hi,
>
> I am starting to use the Perl Compiler perlcc to make some tests... Ok,
> Ok, it's only a beta, maybe an alfa....
>
> But...
>
> I am trying to compile very single scripts using an script that emules
> the PERLCC, basicly it generates the C code with:
>
> perl -I/usr/local/lib/perl5/5.6.1/i686-linux
> -I/usr/local/lib/perl5/5.6.1
> -I/usr/local/lib/perl5/site_perl/5.6.1/i686-linux
> -I/usr/local/lib/perl5/site_perl/5.6.1 -I/usr/local/lib/perl5/site_perl
> -I.  -MO=C,-umain,-uattributes,-uDB,-ofile.c file.pl
>
>
> Then, I compile it using:
>
> gcc  -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -I/usr/local/lib/perl5/5.6.1/i686-linux/CORE  -o ./$arquivo $arquivo.c
> -rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.6.1/i686-linux/CORE
> -L/usr/local/lib
> /usr/local/lib/perl5/5.6.1/i686-linux/auto/DynaLoader/DynaLoader.a
> -L/usr/local/lib/perl5/5.6.1/i686-linux/CORE -lperl -lnsl -ldl -lm -lc
> -lcrypt -lutil -L/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/
> -I/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/
>
> When I use it in a very simple scripts like scripts without calling
> modules, or calling modules like CGI.pm it works fine.
>
> But when I try to use de DBI to connect to a MySQL database, I compile
> the archive, but when I try to execute it returns an error not present
> in the original script:
>
> Can't locate object method "connect" via package "DBI" (perhaps you
> forgot to load "DBI"?) at teste.pl line 9.
>
> I included the mysql DBD directories and put use DBD::mysql into the
> code without sucess.
>
> Do anyone have any idea of what is going on it ?
>
> Thanks
> Slepetys
>

Reply via email to