princepawn has asked for the wisdom of the Perl Monks concerning the following question:
First off, I want to know if I should be using this module or App::Config instead? Second, I dont know why I am having so much trouble taking a configuration and turning it into a hash.
Here is my file (.appconfig)
[urth] User = metaperl Pass = xxxxxxx Host = urth.org RemoteDir = /home/metaperl/rsync Type = I
Here is my program:
use AppConfig; use Net::FTP::Common; use strict; my $config = AppConfig->new({CASE=>1}); $config->file('/Users/metaperl/.appconfig'); my %urth = $config->varlist('^urth_', 1); use Data::Dumper; die Dumper(%urth);
But unfortunately, my output from the program is rather odd:
[localhost:~/src/net_ftp_common/scripts] metaperl% perl rsync.pl urth_User: no such variable at /Users/metaperl/.appconfig line 2 urth_Pass: no such variable at /Users/metaperl/.appconfig line 3 urth_Host: no such variable at /Users/metaperl/.appconfig line 4 urth_RemoteDir: no such variable at /Users/metaperl/.appconfig line 5 urth_Type: no such variable at /Users/metaperl/.appconfig line 6 Died at rsync.pl line 10. [localhost:~/src/net_ftp_common/scripts] metaperl%
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AppConfig help requested
by rob_au (Abbot) on Feb 06, 2002 at 09:41 UTC | |
|
Re: AppConfig help requested
by simon.proctor (Vicar) on Feb 06, 2002 at 08:53 UTC | |
|
Re: AppConfig help requested
by Cepa (Acolyte) on Feb 06, 2002 at 08:08 UTC | |
by runrig (Abbot) on Feb 07, 2002 at 00:52 UTC |