##// END OF EJS Templates
Switch to Config::Tiny. It comes out of the box with ActivePerl at least.
Jani Honkonen -
r1149:b32dfc788188
parent child
Show More
@@ -1,13 +1,6
1 package Jobs;
1 package Jobs;
2 use File::Basename;
2 use File::Basename;
3 use Config::IniFiles;
3 use Config::Tiny;
4
5 # NOTE:
6 # Config::IniFiles is from CPAN
7 # http://search.cpan.org/dist/Config-IniFiles-2.72/
8 #
9 # On windows (ActivePerl) install it from command line by calling:
10 # ppm install Config-IniFiles
11
4
12 sub get {
5 sub get {
13 my $inifile = shift;
6 my $inifile = shift;
@@ -18,11 +11,10 sub get {
18 $jobname =~ s/$prefix//;
11 $jobname =~ s/$prefix//;
19
12
20 # read ini file
13 # read ini file
21 my %cfg;
14 my $cfg = Config::Tiny->read( $inifile );
22 tie %cfg, 'Config::IniFiles', ( -file => $inifile );
23
15
24 # get section from ini by jobname
16 # get section from ini by jobname
25 my %job = %{$cfg{$jobname}};
17 my %job = %{$cfg->{$jobname}};
26 if (!%job) {
18 if (!%job) {
27 die ("Unknown jobname! Check $inifile and bamboo job name.");
19 die ("Unknown jobname! Check $inifile and bamboo job name.");
28 }
20 }
General Comments 0
You need to be logged in to leave comments. Login now