In my understanding you want to process user input data by data_verify
so it would be more efficient and less misleading to redesign and rename
sub data_verify e.g. to process_input and call after each <>
sub process_input{
my $data = shift;
chomp($data); # cut off newline
$data =~ s/^\s*//; # remove leading blanks
$data =~ s/\s*$//; # remove trainilg blanks
return $data;
}
I would store the given information in a hash rather than an array, but that's my personal preference.
if ( ( $option !~ m{/^\d$/}xms ) or ( $option <= 0 ) or ( $option > 10 ) ) {
should be better /^\d+$/ otherwise it will match only single digits and you will never be able to quit (10).
seperate main_menu from db_connect to an extra sub would be better understandable
... I'm just thinking loudly ... oh, did I write that ?