Subject: | EXPAND_UID problem? |
The AppConfig module has been a really nice package to use, and
I've been using it for a while now. Recently, I tried to use a
new (to me) feature: EXPAND_UID for parsing AppConfig configuration
files. However, this feature doesn't seem to work correctly.
I've attached a sample script that I think demonstrates this problem.
I've tried this with AppConfig versions 1.56, 1.63, and 1.66, and
all exhibit the same behavior.
When I trace the code to the line in POSIX.pm that errors out, it's
complaining because two arguments are being passed to getpwnam(): the
first is an object ($self), and the second is the username to expand.
$ ./expanduid.pl
Passed the first one OK ()
Usage: POSIX::getpwnam(name) at /usr/share/perl5/AppConfig/File.pm line 397
I've reproduced this problem with perl 5.8.8, 5.8.9, and 5.10.1
(Solaris, Mac OS X, and Linux respectively).
Thanks.
- Daniel
Subject: | a.config |
Message body not shown because it is not plain text.
Subject: | expanduid.pl |
#!/usr/bin/perl
use AppConfig;
my $config = AppConfig->new( 'poll_file|f=s', { EXPAND => AppConfig::EXPAND_UID } );
# Some parameters on the command-line may be needed to bootstrap the process
$config->getopt();
printf "Passed the first one OK (%s)\n", $config->get('poll_file');
$config->file('a.config'); # This call fails
printf "Passed the second one OK (%s)\n", $config->get('poll_file');
exit 0;