in reply to Can't call method "do" on an undefined value error

That's nice. But you're not calling a method on $dbname, you're calling it on $db.

I'd say next time try actually reading the error message for understanding, but judging by the OP's past performance taking simple advice it'd be pointless . . .

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.