Your inconsistent indentation makes it hard to follow your code (even when I run it through
perltidy), but I suspect you are never calling either function. I think your "MAIN SCRIPT" code is actually inside your warning_entry sub. Try adjusting your curly braces.
Switch statements