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%
In reply to AppConfig help requested by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |