1 Eintrag, 1 Seite |
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
#!/usr/bin/perl
use strict;
use warnings;
use AppConfig;
my $config = new AppConfig;
$config->define("module|modules|m=s%" => { DEFAULT => 'off' });
$config->file(\*DATA) if @ARGV == 0;
$config->getopt('gnu_getopt');
my %modules = %{ $config->modules()};
print "# $_ = $modules{$_}\n" for keys %modules;
printf("Module: %s = %s\n", $_, $modules{$_})
for grep { defined $modules{$_} && lc $modules{$_} eq 'on' }
keys %modules;
_ _DATA_ _
# Configuration File
Module FTP = On
Module WWW = Off
% myapp --module 'WWW=On'
1
2
3
# Ausgabe:
Use of uninitialized value in concatenation (.) or string at myapp line 18.
# WWW =
1 Eintrag, 1 Seite |