in reply to Re^2: Class::DBI error?
in thread Class::DBI error?

If the body is just a single record, you should be able to load that with the same code, just without the loop.

I'm guessing the 0's you are seeing are empty arrays in scalar context, which would happen if you got no records back. You might want to put in a quick check after your retrieve to make sure you are getting a record back. If no records are retrieved, $thread will be undef. Actually, you'll want code to catch this anyway and handle it nicely.

Replies are listed 'Best First'.
Re^4: Class::DBI error?
by stonecolddevin (Parson) on Jun 10, 2005 at 12:09 UTC
    ahhh, so would you recommend wrapping it in eval{} and checking $@?
    UPDATE:Murr...should probably just check $thread for emptyness, right?
    meh.
      No, I think a simple 'if' should do the trick:
      if( not $thread){ # Send a message to the user in some way... print"No record found for thread number: $id"; # Get out of the structure in some way... exit; }
        Ah, fantastic. It's still returning zeros however..
        meh.