Hi Thomas,
I tryied the use mysql, use DBD::mysql, use DBI::mysql without sucess.
The DBD::mysql runs ok in the perl interpreted code, the others give me an
error like:
Can't locate DBI/mysql.pm in @INC....
Could you pass me the exactly use sintax ?
Thanks a lot !!
[]s
Slepetys
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Roberto Slepetys Ferreira" <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 7:29 PM
Subject: Re: PERLCC and DBI
> > Hi Ilya,
>
> Hi Roberto,
>
> >
> > The first think that I made was to run the script with perl, and it
worked
> > fine.
>
> I tried the same some weeks ago. With the same result. The perlcc compiler
> is not able to load the DBD::mysql module. You have to do that yourself.
> I am not really sure how I did it but I thing a line like:
>
> use mysql
>
> is just enough. Maybe "use DBI::mysql" or something similar... I can
> not remember exactly. But when you include this line below
> "use DBI", the compiler will recognize that he has to load the module...
> The result is a huge binary which is not a bit faster that the perlscript
:-)
>
> Regards
> Thomas
>
>
> >
> > The script is very simple, only for tests:
> >
> > #!/usr/bin/perl
> >
> > use CGI qw(:standard);
> > use DBI;
> >
> > 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
> > >
> >
>
>