Hello, we have been asked to take over a website built using perl (it's a club site). The author is not available to help much, but has passed us on the contents of the db and the site.

At this point we just want (need) to transfer the site to our hosting company and then we will figure out where to go. The club administrator would like to get some yearend data in the db and then next year we can go at updating it as it's pretty outdated coding for the html.

We have the database set up and it seems ok. Originally the db was in postgresql. We converted it in workbench to mysql. Our provider has indicated the hostname to use is localhost.

We'd be really grateful if anyone could take a look and let us know if you see a problem with the code below. And if not suggest where we might look for clues. The file is a .pm file.

Thanks in advance. If anything else is needed please let us know.

Attagirl
sub DbConnect { print DEBUG "In DbConnect\n"; use Sys::Hostname; $Hostname=hostname; $MyDB="db######"; if($Hostname !~ /myurl/){ $User="root"; #just for local version. $PW=''; #just for local version. } else { $User="db######"; open(PASS,"$ProgOption{PasswordFile}"); $PW=<"######">; chomp $PW; } #print DEBUG " $ProgOption{dbh}=DBI->connect('DBI:mysql:host=localhos +t;database=$MyDB','$User','$PW',{PrintError =>0, RaiseError => 1})\n" +; $ProgOption{dbh}=DBI->connect("DBI:mysql:host=localhost;database=$My +DB","$User","$PW",{PrintError =>0, RaiseError => 1}); return $ProgOption{dbh}; }

In reply to db connection help by attagirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.