L.C. Posted February 19, 2010 Report Posted February 19, 2010 (edited) my %config = ( require "./config.pl"; # load user accessible configuration blahblahotherstuffhere; ); That obviously does not work. How do I get it to load a specific file -- or "include" just like in PHP? EDIT: That or someone ought to package me a TCAdmin/formal-gameserver ready package of ChatNet. Then I could offer ChatNet hosting. Edited February 19, 2010 by L.C. BlueT Network AdministratorSSCV Network AdministratorJackpot SVS System Operatorhttp://www.hlrse.net/Qwerty/randomsubsbar.jpghttp://www.hlrse.net/Qwerty/BlueToastWebhosting.gif
JoWie Posted February 19, 2010 Report Posted February 19, 2010 I usually do something along the lines of: my %defaultconfig = ( bla => 'bla', ); my %userconfig = do "bnc.conf" or die("Unable to load config file: $!"); my %config = (%defaultconfig, %userconfig); bnc.conf looks like: return ( something => 'bla' );
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now