use CGI::Cookie; my %cookies = fetch CGI::Cookie; if(check_login() && not validate_login() ) { logout_user(); } else { my $sth = $db->prepare("SELECT * FROM sites WHERE webmaster_email='" . $cookies{'email'} . "' AND webmaster_url='" . $cookies{'url'} . "' LIMIT 1"); $sth->execute() or die "Can't execute statement: $DBI::errstr"; my @userinfos; while (my $ref = $sth->fetchrow_arrayref()) { push(@userinfos , [@$ref]); } }