Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. !!PERL!! "Can't locate object method 'connect' via package DBI ....(perhaps you forgot to load "DBI" ?)"

!!PERL!! "Can't locate object method 'connect' via package DBI ....(perhaps you forgot to load "DBI" ?)"

Scheduled Pinned Locked Moved Web Development
helpperlhtmlapachedatabase
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bilas
    wrote on last edited by
    #1

    Hi, everybody. I am beginner in Perl programming and I have the next problem when I try to run my script from shell(in Windows it is cmd.exe). The problem was described in theme. My whole code: I'll be very thankful for help. #--My code begins here--------------- #!c:\perl\bin\perl.exe -w use DBI; my $dbh = DBI->connect('DBI:mysql:perl:localhost','root','join'); #An error is in the string above $sth = $dbh->prepare("select * from ever"); $sth->execute; print "Content-type: text/html\n\n"; &GetFormInput; #-----------------------Remaining part of code is correct and right----- sub GetFormInput { (*fval) = @_ if @_ ; local ($buf); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN,$buf,$ENV{'CONTENT_LENGTH'}); } else { $buf=$ENV{'QUERY_STRING'}; } if ($buf eq "") {return 0;} else { @fval=split(/&/,$buf); foreach $i (0 .. $#fval){ ($name,$val)=split (/=/,$fval[$i],2); $val=~tr/+/ /; $val=~ s/%(..)/pack("c",hex($1))/ge; $name=~tr/+/ /; $name=~ s/%(..)/pack("c",hex($1))/ge; if (!defined($field{$name})) { $field{$name}=$val; } else { $field{$name} .= ",$val"; #if you want multi-selects to goto into an array change to: #$field{$name} .= "$val"; } } } return 1; } -------------------------------------------------------------------- My folder DBI contains the next modules *.pm: DBI DBM DBD ANSI APACHE FAQ FILE GETINFORETURN GETINFOTYPE METADATA MYSQL NANO ODBC PROFILE PROFILEDATA PROFILEDUMPER PROXY PROXYSERVER SPONGE It's clear that's dark.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups