for my $var ( keys %error_msgs ) { no strict 'refs'; unless ( $$var ) { print div( { class=>'tip'}, $error_msgs{ $_ } ); $error_found++; } }