hesco has asked for the wisdom of the Perl Monks concerning the following question:
I've been searching cpan for configuration modules to supplant my hand-rolled beauties. But with some 2200 to look through, I haven't yet found the one that seems to fit my needs, including parsing the url and using that to choose the config file.
Here is the code which does the work for an application I wrote:
I trust that might give a better idea of what I'm talking about that perhaps my prose does.sub parse_config_directory { my($url)=@_; my $conf = $url; my $scriptpath = $0; my $scriptname = $0; $scriptname =~ s/^(.*)\///; $scriptpath =~ s/$scriptname//; $conf =~ s/https:\/\///; $conf =~ s/http:\/\///; $conf =~ s/\//./g; $conf =~ s/\.$scriptname//; $conf = $scriptpath."conf.d/".$conf."/MyApp.conf"; return $conf; } # END parse_url
Can anyone here recommend something that would fill this bill, or do I need to build and contribute back a Config::Simple::VirtualHost? Maybe that is not quite the name for what I'm talking about, perhaps. Surely I'm not the first person to reach for this. Am I?
-- Hugh
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there such an animal as Config::Simple::VirtualHost?
by philcrow (Priest) on Apr 25, 2006 at 13:30 UTC |