I'm trying to get Config::Std working on a server for some cgi stuff..
(Not sure where to look for more info on this)
It works great on my workstation(FC kernel 2.6)and on one server (Suse kernel 2.6) - and then.. i have these two other boxes with FreeBSD (no root access to these guys), and i'm having the thing poop out.. I wonder if it's the architectures and not something else???
Test code follows..
my $conf = load_conf(); sub load_conf { my $arg= shift; $arg->{filename} ||= 'site.conf'; unless( -f cwd."/$$arg{filename}" ){ open(CONF, ">".cwd."/$$arg{filename}") or die($!); print CONF define_default_conf(); close CONF; } read_config( "$$arg{filename}" => my %conf); # line 317 return \%conf; } sub define_default_conf { my $defaultconf = <<"DEFAULTCONF"; # config file for site [Paths] # relative to cgi content_dir: $ENV{DOCUMENT_ROOT}/content thumbnails_dir: $ENV{DOCUMENT_ROOT}/.thumbnails metadata_dir: $ENV{DOCUMENT_ROOT}/.metadata templates_dir: $ENV{DOCUMENT_ROOT}/templates [Settings] main_template_filename: template.html request_param: section DEFAULTCONF return $defaultconf; }
I get this error:
Malformed prototype for Config::Std::Hash::read_config: $\%$ at index.cgi line 317.The file does not get created also- .
Same damn code works perfect on the suse and fedora boxes. Also tried having the files already there (instead of creating defaults.. but same error. I'm so sad.. Config::Std made by *the* DC)
Does anything here look familiar to you?
update Sept 06 2006
Config::Std is nice, but I've had some problems using it in the real world accross different hosting accounts. The reality is that hosts do not maintain their perl and other modules up to date. And we do not always have the choice of where our software runs.
I sadly switched to using CGI::Ex::Conf with YAML which does do the job, and well.
This is sad because Config::Std was made by Damian Conway, who also made Smart::Comments, and wrote Perl Best Practices. ( wow )
In reply to problem with Config::Std on FreeBSD box? by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |