annotate lib/conf.pm @ 3:78afd7f439f3 draft default tip

master branch Updating with tag :CI_COMMIT_TAG - - Fxx
author fgiacomoni
date Wed, 15 Feb 2023 15:57:49 +0000
parents 86296c048e46
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
1 package lib::conf ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
2
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
3 use strict;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
4 use warnings ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
5 use Exporter ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
6 use Carp ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
7 use Data::Dumper ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
8
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
9 use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS);
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
10
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
11 our $VERSION = "1.0" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
12 our @ISA = qw(Exporter) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
13 our @EXPORT = qw( as_conf get_value_from_conf check_path_and_file ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
14 our %EXPORT_TAGS = ( ALL => [qw( as_conf get_value_from_conf )] ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
15
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
16 =head1 NAME
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
17
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
18 conf - A module for manage pfem conf file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
19
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
20 =head1 SYNOPSIS
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
21
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
22 use conf ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
23 my $object = conf->new() ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
24
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
25 =head1 DESCRIPTION
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
26
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
27 This module does manage conf file (extract all or selected fields)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
28
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
29 =head1 METHODS
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
30
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
31 Methods are :
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
32
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
33 =head2 METHOD new
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
34
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
35 ## Description : new
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
36 ## Input : $self
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
37 ## Ouput : bless $self ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
38 ## Usage : new() ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
39
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
40 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
41 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
42 sub new {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
43 ## Variables
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
44 my $self={};
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
45 bless($self) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
46 return $self ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
47 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
48 ### END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
49
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
50 =head2 METHOD as_conf
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
51
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
52 ## Description : permet de cr�er l'object conf � partir d'un fichier de conf de type KEY=VALUE
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
53 ## Input : $file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
54 ## Ouput : $oConf (a hash)
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
55 ## Usage : my ( $oConf ) = as_conf( $file ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
56
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
57 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
58 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
59 sub as_conf {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
60 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
61 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
62 my ( $file, $separator ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
63
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
64 # if (!defined $separator) { $separator = ';' } ## set separator to ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
65
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
66 if ( !defined $file ) { croak "Can't create object with an none defined file\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
67
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
68 my %Conf = () ; ## Hash devant contenir l'ensemble des parametres locaux
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
69
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
70 if (-e $file) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
71 open (CFG, "<$file") or die "Can't open $file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
72 while (<CFG>) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
73 chomp $_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
74 if ( $_ =~ /^#(.*)/) { next ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
75 elsif ($_ =~/^(\w+?)=(.*)/) { ## ALPHANUMERIC OR UNDERSCORE ONLY FOR THE KEY AND ANYTHING ELSE FOR VALUE
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
76
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
77 my ($key, $value) = ($1, $2) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
78
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
79 if (defined $separator) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
80 if ( $value=~/$separator/ ) { ## is a list to split
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
81 my @tmp = split(/$separator/ , $value) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
82 $Conf{$key} = \@tmp ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
83 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
84 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
85 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
86 $Conf{$key} = $value ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
87 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
88 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
89 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
90 close(CFG) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
91 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
92 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
93 croak "Can't create object with an none existing file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
94 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
95
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
96 return ( \%Conf ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
97 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
98 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
99
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
100 =head2 METHOD as_conf_list
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
101
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
102 ## Description : permet de charger une liste txt en array
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
103 ## Input : $file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
104 ## Output : elements
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
105 ## Usage : my ( elements ) = as_conf_list( $conf_file ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
106
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
107 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
108 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
109 sub as_conf_list {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
110 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
111 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
112 my ( $file ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
113
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
114 my @elements = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
115 if ( !defined $file ) { croak "Can't create object with an none defined file\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
116
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
117 if (-e $file) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
118 open (CFG, "<$file") or die "Can't open $file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
119 while (<CFG>) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
120 chomp $_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
121 if ( $_ =~ /^#(.*)/) { next ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
122 elsif ($_ =~/^(.*)/) { if (defined $1) { push (@elements, $1) ; } }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
123 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
124 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
125 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
126 croak "Can't create object with an none existing file\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
127 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
128 return(\@elements) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
129 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
130 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
131
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
132 =head2 METHOD get_value_from_conf
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
133
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
134 ## Description : permet de retourner une valeur du hash de conf � partir d'une key
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
135 ## Input : $oConf, $Key
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
136 ## Ouput : $Value
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
137 ## Usage : my ( $Value ) = get_value_from_conf( $oConf, $Key ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
138
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
139 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
140 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
141 sub get_value_from_conf {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
142 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
143 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
144 my ( $oConf, $Key ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
145
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
146 my $Value = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
147
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
148 if ( defined $oConf ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
149 if ( defined $oConf->{$Key} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
150 $Value = $oConf->{$Key} ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
151 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
152 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
153 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
154 croak "Can't manage value with undefined object\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
155 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
156 return($Value) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
157 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
158 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
159
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
160 =head2 METHOD get_value_from_conf
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
161
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
162 ## Description : permet de retourner une valeur du hash de conf � partir d'une key
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
163 ## Input : $oConf, $Key
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
164 ## Ouput : $Value
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
165 ## Usage : my ( $Value ) = get_value_from_conf( $oConf, $Key ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
166
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
167 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
168 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
169 sub split_value_from_conf {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
170 ## Retrieve Values
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
171 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
172 my ( $oConf, $Key, $sep ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
173
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
174 my $value = undef ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
175 my @values = () ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
176
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
177 if ( defined $oConf ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
178 if ( defined $oConf->{$Key} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
179 $value = $oConf->{$Key} ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
180 @values = split ( /$sep/, $value) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
181 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
182 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
183 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
184 croak "Can't manage value with undefined object\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
185 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
186 return(\@values) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
187 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
188 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
189
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
190
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
191 =head2 METHOD check_path_and_file
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
192
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
193 ## Description : permet de v�rifier les path et la pr�sence des exe d�crits dans le file conf. Bloque le script en cas de probleme
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
194 ## Input : $oConfs
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
195 ## Ouput : NA
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
196 ## Usage : &get_value_from_conf( $oConf ) ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
197
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
198 =cut
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
199 ## START of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
200 sub check_path_and_file {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
201
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
202 my $self = shift ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
203 my ( $oConfs ) = @_ ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
204
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
205 foreach my $conf ( keys %{ $oConfs } ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
206 if ( $conf =~ /^FILE/ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
207 if ( -e $oConfs->{$conf} ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
208 if ( -s $oConfs->{$conf} ) { next ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
209 else { carp "[Warning] : The size of file $oConfs->{$conf} is null\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
210 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
211 else {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
212 carp "[Warning] : The file $oConfs->{$conf} doesn't exist\n" ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
213 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
214 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
215 elsif ( $conf =~ /^PATH/ ) {
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
216 if ( -d $oConfs->{$conf} ) { next ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
217 else { carp "[Warning] : The dir $oConfs->{$conf} doesn't exist\n" ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
218 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
219 else { next ; }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
220 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
221 return ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
222 }
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
223 ## END of SUB
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
224
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
225 1 ;
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
226
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
227
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
228 __END__
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
229
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
230 =head1 SUPPORT
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
231
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
232 You can find documentation for this module with the perldoc command.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
233
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
234 perldoc conf.pm
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
235
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
236
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
237 =head1 Exports
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
238
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
239 =over 4
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
240
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
241 =item :ALL is as_conf get_value_from_conf
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
242
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
243 =back
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
244
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
245 =head1 AUTHOR
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
246
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
247 Franck Giacomoni E<lt>franck.giacomoni@clermont.inra.frE<gt>
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
248
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
249 =head1 LICENSE
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
250
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
251 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
252
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
253 =head1 VERSION
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
254
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
255 version 1 : 10 / 02 / 2013
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
256
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
257 version 2 : ??
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
258
86296c048e46 Init repository for [hr2]
fgiacomoni
parents:
diff changeset
259 =cut