http://www.perlmonks.org?node_id=1016502


in reply to CLI Args and Config Files: Best Practices?

Thanks for the reply perl514. Config::Tiny is fine for half of my problem. I was already using Config::Simple, which is about the same sort of thing just a little more feature-rich. I really wanted to bring all my argument handling under one roof - which AppConfig does really well

Anonymous Monk - yup, I just went ahead and did the AppConfig swicheroo specced out in my OP which works just fine for now, scribbled down a note about it just in case I need to change things. Excellent documentation! =)

It's also worth noting that most daemon(izer|ing|esque) modules don't play nice on Windows (as in, do not have ported incarnations compiled and waiting in the Perl Package Manager). Of course you had no way of knowing that I am shackled to a Windows machine. Oh, how I miss the days in sunny Linux pastures; frolicking with the tame, OS-supported fork implementations.

So to summarize my current solution: before initializing AppConfig I save @ARGV to more permanent place and just reparse all those arguments immediately after refreshing from the config file. This way I get to keep my CLI args just like I want but I can change other arguments 'on the fly' through the config file.

Now I'll just have to dream up a way to override that behavior, if necessary...

Strange things are afoot at the Circle-K.