in reply to Trouble working with Config::Simple

I'm still having trouble getting it to write the .kenesis file: I have tryed replacing `$cfg->write("~/.kenesis");` with `$cfg->write("$ENV{HOME}/.kenesis");` and adding `or die $cfg->error();` didn't produce an error. Running $ENV{HOME} through perl -e comes back with the following
Bareword found where operator expected at -e line 1, near "/etc/bash" (Missing operator before bash?) syntax error at -e line 1, near "/etc/bash" Execution of -e aborted due to compilation errors.
. I also tried adding in the full path to my home directory and still no file.

Replies are listed 'Best First'.
Re^2: Trouble working with Config::Simple
by vendion (Scribe) on Jul 09, 2008 at 00:22 UTC
    Running this code:
    #!/usr/bin/perl use strict; use warnings; use Config::Simple; our $cfg; my @player; my $completed_quests = "zero"; my $special_item = "zero"; my @enemy; my $class = "zero"; $cfg = new Config::Simple(syntax=>'simple'); $cfg->autosave(1); $cfg->param("player", "@player"); $cfg->param("quest", "$completed_quests"); $cfg->param("items", "$special_item"); $cfg->param("enemy", "@enemy"); $cfg->param("class", "$class"); $cfg->write("$ENV{HOME}/.kenesis");

    outside of my game works but when using it inside the game it doesn't. Maybe it is the way I have it running, right now I have the code for Config::Simple spread out in my main program, but in this test one they are all grouped together variables are created and given a value then everything is written to the file.