On Mon, 2009-08-10 at 17:14 -0400, Chas. Owens wrote: > On Mon, Aug 10, 2009 at 16:56, Martin Spinassi<martins.li...@gmail.com> wrote: > snip > > The problem with that, is that one variable is added/removed from the > > global config, then it should be changed at the script. > > > > I don't know if this can do the trick, what do you think? > snip > > It sounds like you should switch to a config file instead of trying to > use use, require, do, or eval. Take a look at [Config::Simple][1] and > everything else in [Config::*][2] on [CPAN][3]. > > [1] : http://search.cpan.org/dist/Config-Simple/Simple.pm > [2] : http://search.cpan.org/search?query=Config%3A%3A&mode=all > [3] : http://search.cpan.org
Chas, I've been reading Config-Simple, and it's, as it name say, really simple. The problem here is that it would work great for an application with let's say, 50 statical options, with little or no change, and it's not the case. What I'm trying to do is a firewall with iptables script. As I always finish doing a new script every time I've to install a firewall, I wanted to make something more perdurable and can carry from different servers, something like my ultimate firewall script :D. The global config have some basics as gateways, lan, dns, etc. Also there are others config files with common services ports, etc. Using Config-Simple for that is a pain. Doing %Config{'option'} for every variable is too complex. The difference from making $wan_interface vs. %Config{'wan_interface'} hundred of times on iptables rules are tricky, and making a new variable for each one, ex: on main script make a $wan_interface=%Config{'wan_interface'} has no sense to make the variables on different files. Should I use bash instead of perl for these job? May be some variant of "require" that let me use strict? Thanks again to all. Cheers Martin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/