I need help

Поиск
Список
Период
Сортировка
Искать

I need help

От:
root <root@cariari.ucr.ac.cr>
Дата:
I have program in Perl and it invok a database en postgrest, and I use
commands as it:  my $pdbh = Pg::connectdb($p_dbms) ||               die "no se puede conectar.";    $x = $codigo;    $res = Pg::doQuery($pdbh, "SELECT * FROM gente WHERE codigo = $x",\@ar)
then when I run the program it present errores as    Undefined subroutine&Pg::connectdb called at bd_pons1.pl line 135. main::Accese_Bd called at bd_pons1.pl line 23
I want know if can you help me below find the script and can you test and
tell me where is the problem please.
thanks

#!/usr/bin/perl
# --------------------------------------------------------------bd_pons.pl
#       Este programa para atender la solicitud de consulta o
#       actualizacin.
#
# --------------------------------------------------------------------

use CGI qw /:standard/;
#use DBI;

#

#use Pg;
my $p_dbms = "dbname=philip user=philip";
my $p_user = "user=philip";
my $p_pw   = "password=";

#my $q = new CGI  /qw:standard/;
#print $q->header;
$entrada=&Entrada;       &Parametros ($entrada);       &Cabecera_HTML;       &Accese_Bd;    if (&Va_Actualizar) {               &Proceso_Act;               exit 0;       } elsif  (&Va_Home_Page) {               &Proceso_Home_Page;               exit 0;       } else {               &Proceso_Consulta;               exit 0;       }

sub Proceso_Consulta {       print "\n";       print "Que Toque\n";       print "\n";       print "\n";       print "

IPI\.

\n"; print "
\n"; print "

 

\n"; print "

Cdigo de usuario $x

\n"; print "

Nombre: $nom Depto: $dpto

\n"; print "

Telefono: $tel

\n"; print "

Correo: $k_corr al $f_corr

\n"; print "

Directorio: $k_home al $f_home

\n"; print "

Tiene home page: $h_p; Fecha vencimiento: $ print "

Informacin adicional: $info_gen

\n"; print "

Muchas Gracias

\n"; print "\n"; print "\n"; } sub Entrada{ local ($entrada); if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $entrada, $ENV{'CONTENT_LENGTH'}); }else{ $entrada = $ARGV[0]; } return $entrada; } sub Parametros { local ($linea) = @_; $linea =~ s/\?/ /g; $linea =~ s/\+/ /g; $linea =~ s/\&/=/g; $linea =~ s/%(..)/pack("C",hex($1))/ge; @regis = split(/=/, $linea); $codigo = $regis[1]; $define = $regis[3]; # print "

$clave es $valor

\n"; } sub Cabecera_HTML{ print "Content-type: text/html\n\n"; } sub Va_Actualizar { if ($actualiza) { return 1; # print "

VINO POR ACTUALIZA

\n"; } return 0; } sub Proceso_Act { print "\n"; print "Actualizacin de Usuarios\n"; print "\n"; print "\n"; print "

Centro de Informtica: \n"; print "Administracin de Usuarios.

\n"; print "\n"; print "

Actualizacin del Cdigo de Usuario \n"; print "\n"; print "

\n"; print "Telfono: \n"; print "_____Fecha Ingreso: \n"; print "_____Fecha Vencimiento:

\n"; $x_gen = '"' . $info_gen . '"'; print "Info Adicional: print "
\n"; print "\n"; print "

\n"; print "\n"; print "\n"; } sub Va_Home_Page { if ($home_page) { return 1; } return 0; } sub Proceso_Home_Page { print "

VINO POR HOME_PAGE

\n"; } sub Accese_Bd { my $pdbh = Pg::connectdb($p_dbms) || die "no se puede conectar."; $x = $codigo; $res = Pg::doQuery($pdbh, "SELECT * FROM gente WHERE codigo = $x",\@ar) $ced = $ary[0][1]; $nom = $ary[0][2]; $dpto = $ary[0][3]; $tel = $ary[0][4]; $c_corr = int ($ary[0][5] / 1024); $k_corr = $c_corr . "k"; $f_corr = $ary[0][6]; $c_home = $ary[0][7]; $k_home = $c_home . "k"; $f_home = $ary[0][8]; $h_p = $ary[0][9]; $f_venc = $ary[0][10]; $info_gen = $ary[0][11]; if (($h_p eq "t") || ($h_p eq "T")) { $h_p = "S"; } else { $h_p = "No"; } }
FAQ