Config-Yak

 view release on metacpan or  search on metacpan

lib/Config/Yak.pm  view on Meta::CPAN

165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
Hash::Merge::set_behavior('RETAINMENT_PRECEDENT');
foreach my $file ( @{$files_ref} ) {
    if ( -e $file ) {
        try {
            my $Config = Config::Tiny::->read($file);
            print '_load_legacy_config - Loaded ' . $file . "\n" if $self->debug();
            Data::Structure::Util::unbless($Config);
            $cfg = Hash::Merge::merge( $cfg, $Config );
            ## no critic (ProhibitMagicNumbers)
            my $last_ts = ( stat($file) )[9];
            ## use critic
            $self->last_ts($last_ts) if $last_ts > $self->last_ts();
            1;
        } ## end try
        catch {
            warn "Loading $file failed: $_\n" if $self->debug();
        };
    } ## end if ( -e $file )
} ## end foreach my $file ( @{$files_ref...})
return $cfg;

lib/Config/Yak.pm  view on Meta::CPAN

252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
            }
        }
        $cfg = $ncfg;
    } ## end if ( ref($cfg) eq 'ARRAY')
    if ( ref($cfg) eq 'HASH' ) {
        foreach my $file ( keys %{$cfg} ) {
            print "_load_config - Loaded $file\n" if $self->debug();
            push(@{$self->files_read()},$file);
            $ccfg = Hash::Merge::merge( $ccfg, $cfg->{$file} );
            ## no critic (ProhibitMagicNumbers)
            my $last_ts = ( stat($file) )[9];
            ## use critic
            $self->last_ts($last_ts) if $last_ts > $self->last_ts();
        } ## end foreach my $file ( keys %{$cfg...})
    } ## end if ( ref($cfg) eq 'HASH')
    return $ccfg;
} ## end sub _load_config
 
############################################
# Usage      :
# Purpose    :



( run in 0.992 second using v1.01-cache-2.11-cpan-49f99fa48dc )