in reply to Opening a file for writing

Which of your code lines is line 31 of shannon.pl? Not the ones you posted, I deem, since you clearly stick gamesave.txt into your variable $gamesave, but perl croaks about gamelog.txt.

That error is thrown if you try to do

use strict; my $file = ">gamelog.txt"; open $file, $file or die;

which you appear to be doing elsewhere in your code.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}