in reply to Opening a file for writing

Works fine for me as this code:
use strict; use warnings; my $gamesave = "gamesave.txt"; my @secrettext_new; open(LOG, ">$gamesave") or die "Error: $!"; print LOG join(" ", @secrettext_new); close(LOG) or die "Error: $!"
... the only change I made was to define @secrettext_new to avoid warnings.

Maybe it is something in the preceding lines that is the problem.

My perl version is:
This is perl, v5.8.8 built for sun4-solaris-thread-multi
Update: Added perl version