Can't call method "ct_execute" on an undefined value at /local/www/htdocs/scripts/pimgmt/nc_pf_58mainmenu.pl line 3717.
Here's the main script that calls various subroutines (notice no use strict; at this point in time but I'm hoping to change that once I dig in):
And here's the subroutine where the error message is generated:#!/usr/local/bin/perl5_8 use CGI; use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); use vars qw($CGI); use Sybase::CTlib; $CGI = new CGI(); # Get parameters based on login, etc. &get_parms($CGI); # When global employee id ($g_empid) is blank, # initialization routines are bypassed and you drop out. if ( $g_empid eq "" ) { &valid_user; } # Clear the STDOUT buffers so MIME can get out; print html headers $|=1; print "content-type: text/html\n\n"; # Display Campus Main Menu and begin main processing &main_process;
So, I dug around here for some answers... and have read a lot (the rods and cones in my eyes are going nuts staring at a white screen for so long). I'm getting the impression the database doesn't like how I'm speaking to it, but that's only a guess. Do I need to tweak something because of the new version of Perl? Thanks for any help you can provide! Lorisub valid_user() { # INITIALIZATION STEP 1: # Check system availability &set_db_env; $get_results=0; $sql = "select STATUS , MESSAGE FROM $g_pfsec_db.dbo.NC_PF_STATUS "; $db_avail= new Sybase::CTlib $g_pfsecid,$g_pfsecpw,$g_pfsecsrv; $db_avail->ct_execute($sql) ; <====THIS IS LINE 3717 while ( $db_avail->ct_results($restype) == CS_SUCCEED ) { next unless $db_avail->ct_fetchable($restype); while ( ($dbf_STATUS, $dbf_MESSAGE) = $db_avail->ct_fetch ) { $get_results++; $app_status = "$dbf_STATUS"; if ( $dbf_STATUS eq "U" ) { $|=1; print "content-type: text/html\n\n"; &top_hdrs; &display_msg($dbf_MESSAGE); exit; } }
In reply to Re: Re: Opinions on migrating Perl scripts from 5.005 to 5.8.1?
by Lori713
in thread Opinions on migrating Perl scripts from 5.005 to 5.8.1?
by Lori713
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |