Changeset 1905 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Conf.pm
- Timestamp:
- Oct 9, 2014, 12:14:42 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r1904 r1905 29 29 30 30 our @ISA = qw(Exporter); 31 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_print pb_conf_get_all );31 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_print pb_conf_get_all pb_conf_cache); 32 32 ($VERSION,$REVISION) = pb_version_init(); 33 33 … … 118 118 open(CONF,$cf) || confess "Unable to open $cf"; 119 119 while(<CONF>) { 120 next if (/^#/); 120 121 if (/^\s*([A-z0-9-_.]+)\s+([[A-z0-9-_.]+)\s*=\s*(.*)$/) { 121 122 pb_log(3,"DEBUG: 1:$1 2:$2 3:$3\n"); … … 233 234 234 235 my $conffile = shift; 235 my $h = $_; 236 237 open(CONF,"> $conffile") || confess "Unbale to wirte into $conffile"; 236 my $h = shift; 237 238 confess "No configuration file defined to write into !" if (not defined $conffile); 239 confess "No hash defined to read from !" if (not defined $h); 240 open(CONF,"> $conffile") || confess "Unable to write into $conffile"; 238 241 239 242 foreach my $p (keys %$h) { 240 foreach my $key ($p) { 241 print CONF "$p $key = $p->{$key}\n"; 243 my $j = $h->{$p}; 244 foreach my $k (keys %$j) { 245 print CONF "$p $k = $j->{$k}\n"; 242 246 } 243 247 }
Note:
See TracChangeset
for help on using the changeset viewer.