This was in a subroutine so $outfile was local. I then tried to use it outside the subroutine so that was the problem. I removed the my and now the above call works.

What that tells me is that you aren't using strict, and that you are now creating variables inside of subroutines that you are accessing outside of the subroutines. A better approach would be to let your subroutine return a value that the calling code uses to initialize $outname

Yes, of course, if I had used strict and warnings, this would have been avoided. I know I am following Perl Worst Practices. I will reform my undisciplined coding ways. Thanks, oh brother sufferer, for the admonition. ;) Meanwhile, why is exec behaving so?

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other