@@ -1,13 +1,6 | |||
|
1 | 1 | package Jobs; |
|
2 | 2 | use File::Basename; |
|
3 |
use Config:: |
|
|
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 | |
|
3 | use Config::Tiny; | |
|
11 | 4 | |
|
12 | 5 | sub get { |
|
13 | 6 | my $inifile = shift; |
@@ -18,11 +11,10 sub get { | |||
|
18 | 11 | $jobname =~ s/$prefix//; |
|
19 | 12 | |
|
20 | 13 | # read ini file |
|
21 | my %cfg; | |
|
22 | tie %cfg, 'Config::IniFiles', ( -file => $inifile ); | |
|
14 | my $cfg = Config::Tiny->read( $inifile ); | |
|
23 | 15 | |
|
24 | 16 | # get section from ini by jobname |
|
25 | my %job = %{$cfg{$jobname}}; | |
|
17 | my %job = %{$cfg->{$jobname}}; | |
|
26 | 18 | if (!%job) { |
|
27 | 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