The first one is most likely telling you it is not defined. Before $qglobals, check if defined before checking value.
Code:
if (defined($qglobals{qviclevel}) && $qglobals{qviclevel} == 15 && $ulevel == 70) {
For the second one, it is better to use the plugin.
Code:
if (plugin::check_handin(\%itemcount, 99711 => 1)) {