Subject: | re: simple flags |
Date: | Tue, 24 Mar 2009 11:29:46 -0400 |
To: | bug-AppConfig [...] rt.cpan.org |
From: | Rob Lauer <rlauer6 [...] comcast.net> |
Don't seem to work in sections..
#!/usr/bin/perl
use AppConfig;
use AppConfig qw(:expand :argcount);
use AppConfig qw(ARGCOUNT_NONE ARGCOUNT_ONE);
$config = AppConfig->new(
{
CASE => 1,
CREATE => 1,
ERROR => sub { },
}
);
$config->define("options_cleanup", { DEFAULT => 1, ARGCOUNT =>
ARGCOUNT_NONE } );
$config->define("cds_testing", { DEFAULT => 1, ARGCOUNT => ARGCOUNT_NONE } );
$config->define("foo", { DEFAULT => 1, ARGCOUNT => ARGCOUNT_NONE } );
$config->define("baz", { DEFAULT => 1, ARGCOUNT => ARGCOUNT_NONE } );
$config->file(\*DATA);
printf("testing:[%d]\n", $config->cds_testing);
printf("cleanup:[%d]\n", $config->options_cleanup);
printf("foo[%d]\n", $config->foo);
printf("baz:[%d]\n", $config->baz);
__DATA__
foo
nobaz
[cds]
testing on
[options]
nocleanup
8-<-------------------------
would expect nocleanup to yield 0, baz does yield 0
AppConfig version = 1.56
--
Rob