Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Migrating app to newer perl

by CHRYSt (Acolyte)
on Oct 01, 2003 at 15:54 UTC ( [id://295661]=perlquestion: print w/replies, xml ) Need Help??

CHRYSt has asked for the wisdom of the Perl Monks concerning the following question:

First, I'm pretty new to perl. I've done some simple stuff, like search and replace, and minor text formatting, but nothing even remotely advanced.

I have a perl/MySQL site that was written in Perl 5004-1. I've been tasked with migrating it from the contractor. My server is running perl 5.8.1. Most of it works fine, though I had to comment out instances of CGI::use_named_parameters. (Will that break anything??)

There is at least one section of the site that does not work. When a form is submitted, a query is run. The script calls itself, and then draws the results page (I think) based on the presence of certain variables. The results page draws the template areas of the page, but nothing in the content section, which *should* contain some hard coded HTML, and the results of the query. No errors are reported. When perl is called with -w or -W, the only warnings thrown are:

Name "main::formlist" used only once: possible typo at htgmsrch.pl lin +e 9. Name "main::dbh" used only once: possible typo at htgmsrch.pl line 165 +.
Both of these variables (I think they're arrays) are first used in a file that's require()'d earlier.

Basically, my questions are: Why doesn't it count the formlist and dbh in the require()'d file, and How do I go about troubleshooting this, if there are no errors?

Replies are listed 'Best First'.
Re: Migrating app to newer perl
by Anonymous Monk on Oct 01, 2003 at 20:40 UTC
    Most of it works fine, though I had to comment out instances of CGI::use_named_parameters. (Will that break anything??)
    "Version 2.57 ... 6. Removed use_named_parameters() because of dependency problems and general lameness. "
    You need to know what use_named_params does before you can know if it will break something.
    There is at least one section of the site that does not work. When a form is submitted, a query is run. The script calls itself, and then draws the results page (I think) based on the presence of certain variables. The results page draws the template areas of the page, but nothing in the content section, which *should* contain some hard coded HTML, and the results of the query. No errors are reported.
    Is there a test-suite? If there isn't one, write a test suite with the old perl, make sure it works, and then try it out on the new perl, and see what breaks.
    First, I'm pretty new to perl. I've done some simple stuff, like search and replace, and minor text formatting, but nothing even remotely advanced.
    Then maybe you are not the right person for the job?
Re: Migrating app to newer perl
by jdtoronto (Prior) on Oct 01, 2003 at 19:16 UTC
    Fromthe errors it would appear that somethingis indeed not happening! You are warned that two variables are created or used only once, but never again. So assuming main::dbh is the database handle, then it must be used when the DB is called, somehow that code is not being run.

    Maybe if you can post some more code here we can look at that and help some more.

    jdtoronto

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://295661]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-26 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found