We're somewhere between Stack Overflow and Code Review right now. I have some comments on your style, which is probably down to outdated teaching material. It's good that you have
strict
and
warnings
. Those are helpful. But you should indent your code as well, that'll make it easier to read. Your
open
call has some problems, but they're not the cause of your code not doing what you want (look up
3 argument open if you're interested). —
simbabque 44 secs ago