in reply to Returning and passing data to and from subroutines

By the way,

sub data_verify { my @data = shift; my $loop_count = 0; while (@data) { $data[$loop_count] =~ s/^\s*//; $data[$loop_count] =~ s/\s*$//; $loop_count++; } return @data; }
is equivalent to
sub data_verify { my $data = shift; $data =~ s/^\s*//; $data =~ s/\s*$//; return $data; }

Based on the code in your scratchpad, you want to process multiple values per call. What you really want is

sub data_verify { my @data = @_; for (@data) { s/^\s*//; s/\s*$//; } return @data; }