in reply to Strange undefined scalars in array

Every time this line

while (my $modelselect ne '10')
executes, you are creating a brand new variable called $modelselect. It will always be uninitialised; and thus will never be eq to '10';

Try replacing that line with these two and you might have more success:

my $modelselect; while ( $modelselect ne '10')

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.