www.webdeveloper.com
Results 1 to 3 of 3

Thread: Can't call method "do" on an undefined value

  1. #1
    Join Date
    Feb 2003
    Posts
    1

    Can't call method "do" on an undefined value

    Hello...
    I'm getting this message "Can't call method "do" on an undefined value" when trying to connect to Sybase database using CGI.. this is some parts of the code i have. The code works in one machine but it doesn't work with a different machine. Do you know what would cause this error or what could be different between the machines?

    Thanks,
    Jen

    use DBI;
    use CGI;
    my $dbh;
    .......

    $ENV{'SYBASE'} = "/opt/sybase/" unless (defined $ENV{'SYBASE'});
    ...................

    eval {
    $dbh=DBI->connect("dbi:Sybase:server=$DATA_SOURCE", $USERID, $PWD);
    };
    if( DBI::errstr eq "")
    {

    $dbh->do("use TOPAZ");

    ...........

  2. #2
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    If the code has stayed the same then obviously there must be some difference in the configuration between the two systems. Do they both have Sybase? Are they both configured the same way?
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  3. #3
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    I'm not familiar with Sybase, only mySQL but it would appear that 'dbi' in this line should be uppercase. I would guess that you never connect to the database.
    $dbh=DBI->connect("DBI:Sybase:server=$DATA_SOURCE", $USERID, $PWD);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles