if ($USER{coffee} && $USER{coffee} =~ /\d+/){ $msg = 'You drink too much coffee' if $USER{coffee} > 5; }