Skip Menu |
 

This queue is for tickets about the AppConfig CPAN distribution.

Report information
The Basics
Id: 4284
Status: open
Priority: 0/
Queue: AppConfig

People
Owner: Nobody in particular
Requestors: nashif [...] planux.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: using =s% return undefined hash values
Download (untitled) / with headers
text/plain 848b
With this example code I get undefined hash keys as one can see in the debug output... use AppConfig; use Data::Dumper; # create a new AppConfig object my $config = AppConfig->new(); # define a new variable $config->define("define=s%"); $config->getopt(); print Dumper($config->get("define")); runnning the code with debug enabled: % perl testing/app.pl --define dd=sdfd Variable defined: define VALUE => HASH(0x81ec328) DEFAULT => <undef> ARGCOUNT => 3 VALIDATE => <undef> ACTION => <undef> EXPAND => <undef> Calling GetOptions(define=s%, CODE(0x82a4d88)) @ARGV = (--define, dd=sdfd) AppConfig::State=HASH(0x81ec214)->set(define, dd) AppConfig::State=HASH(0x81ec214)->get(define) => HASH(0x81ec328) $VAR1 = { 'dd' => undef }; A bug, or am I doing osmething wrong?
Download (untitled) / with headers
text/plain 451b
On Mon Nov 03 22:51:32 2003, guest wrote: [...] Show quoted text
> $config->define("define=s%");
[..] Show quoted text
> % perl testing/app.pl --define dd=sdfd
Show quoted text
> $VAR1 = { > 'dd' => undef > };
I'm seeing the same behavior, I applied the suggested fix from here : <http://markmail.org/message/c7eh234ezhnqyljm> -my $linkage = sub { $self->set(@_) }; +my $linkage = sub {$_[1] .= "=" . pop() if ( $#_ eq 2 ); +$self->set(@_)}; and it seemed to work. Brian


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.