in reply to CGI Session Not Working

my $sql001 = $dbh->prepare("SELECT * FROM perl_users WHERE `username` = ? AND `password` = ?");

Side comment: It is best to not use SELECT * outside of EXISTS() clauses and ad-hoc queries. Changing it to, "SELECT id, username" can avoid issues due to column reordering and added or removed columns, save on network traffic, and is self-documenting.