From 67fbca992e44d1d88a51028e474185fd2be6c5bb Mon Sep 17 00:00:00 2001 From: Nigel McNie Date: Mon, 26 May 2008 23:10:55 +1200 Subject: [PATCH] Convert to using a simple INI file in the user's home directory for config, rather than a YAML file. --- tks.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tks.pl b/tks.pl index 36e02ba..8f1489d 100755 --- a/tks.pl +++ b/tks.pl @@ -5,10 +5,11 @@ use warnings; use FindBin; use lib $FindBin::Bin . '/lib'; use Getopt::Declare; -use YAML; +use Config::IniFiles; use WRMS; -my $config = YAML::LoadFile($FindBin::Bin . '/config.yml'); +my %config; +tie %config, 'Config::IniFiles', ( -file => $ENV{HOME} . '/.tksrc' ); my $args = Getopt::Declare->new(q( [strict] @@ -22,14 +23,14 @@ my @data = WRMS::load_timesheet_file($args->{''}); # connect to wrms my $wrms = WRMS->new({ - username => $config->{username}, - password => $config->{password}, - site => $config->{site}, - login => 1, + username => $config{default}{username}, + password => $config{default}{password}, + site => $config{default}{site}, + login => 1, }); # map of textual representations for WRs -my $wrmap = $config->{wrmap}; +my $wrmap = $config{'wrmap'}; my $total_time = 0; -- 2.39.5