For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > April 2007 > AppConfig loading undef values into ARGCOUNT_LIST









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author AppConfig loading undef values into ARGCOUNT_LIST
ksdoctor@fastmail.us

2007-03-22, 6:57 pm

What is the syntax for loading empty (undef) or empty strings into an
AppConfig value set to ARGCOUNT_LIST ?

I am using AppConfig 1.56

Here is a code snippet:
use AppConfig;
my $config = AppConfig->new();

$config->define("Thing=s@");
$config->file("config.txt");

print join("\n", @{$config->Thing()}) . "\n";

--- config.txt---

Thing = 'one'
Thing = ''
Thing = 'three'
Thing = <undef>
Thing = undef

---

The result is only
STDERR : "Thing expects an argument at ./config.txt line 2
STDOUT :
one
<undef>
undef

I would like AppConfig to add an undef or empty string to the list
rather than ignore it.

thanks,
-K S D

Ted Zlatanov

2007-04-03, 7:02 pm

On 22 Mar 2007 11:54:36 -0700 ksdoctor@fastmail.us wrote:

k> What is the syntax for loading empty (undef) or empty strings into an
k> AppConfig value set to ARGCOUNT_LIST ?
....
k> I would like AppConfig to add an undef or empty string to the list
k> rather than ignore it.

I haven't found a way to do this either. I just clear the entry
manually. A better way may be to define a "VAR IS NULL" line, which
would set VAR to undef. But I don't know who's maintaining AppConfig
these days; I asked some questions a year ago and never heard back.

Ted
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com