in reply to do while debacle

If I run this the last line it prints is 'MMnext: 13'. Prints lots of warnings though.

Also, even if the $midxfle file exists it always goes to the system("command").
Well, yeah, that's because your if test is like:
if($midxfle = my $file)
$file is a new variable, whose value is undefined. You assign that to $midxfle, so the result of the entire expression is false.

Abigail