File: multi_config_dir

package info (click to toggle)
libfindbin-libs-perl 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 408 kB
  • sloc: perl: 787; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/env perl
########################################################################
# locate the first config file named "LocalPaths.conf" looking up the 
# tree in ./etc dir's above FinBin::Bin.
########################################################################

use Scalar::Util    qw( first );

use FindBin::libs   qw( base=etc export );

my $base    = 'LocalPaths.conf';

my $found   = first { -e "$_/$base } @etc
or die "No config files found ($base)";