/usr/share/doc/libconfig-merge-perl/examples/func.pl is in libconfig-merge-perl 1.01-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/usr/bin/perl
use strict;
use warnings;
use blib;
use File::Spec();
my $dir;
# Checks for YAML::Syck or YAML
# and finds the path for the config dir
BEGIN {
eval { require YAML::Syck; YAML::Syck->import(); 1 }
or eval { require YAML; YAML->import(); 1 }
or die "ERROR: "
. "YAML::Syck or YAML needs to be installed to use this example\n\n";
my ($vol,$path) = File::Spec->splitpath(
File::Spec->rel2abs($0)
);
$path = File::Spec->catdir(
File::Spec->splitdir($path),
,'config_dev'
);
$dir = File::Spec->catpath($vol,$path,'');
}
# Set up the class My::Config
# Normally this would happen in a startup file
use Config::Merge( 'My::Config' => $dir );
# Import the sub My::Config::C
# You'd put this line into every module which needs access to the config data
use My::Config;
my $path = shift @ARGV || '';
my $data = C($path);
print Dump($data);
|