conf files

2002-06-10 Thread James Taylor

I have this app I just wrote, and I wanted to give my users a more 
'standard' .conf file, instead of forcing them to open up the script, 
and dig through and change variables (Some people get confused by 
this... Go figure).  SO, I wanted to give a .conf sort of like the 
apache conf file where you'll see things like:

ENCRYPTION=1 
#Set this to 0 if you don't want encryption
ENCTYPE=3DES 
# 3DES or BLOWFISH
BASEDIR=/home/user 
# Path to something


## Sockets #

PORT=1200 
# Port to connect to
TYPE=TCP 
# TCP or UDP
HOST=localhost 
# Hostname



You get the idea.  Anyway, I could make a file like this and then 
'require' it I suppose, then run a regex on the lines and assign the 
variables THAT way, but I was curious if anyone could think of a better 
way to do this instead of forcing myself to make all these un-needed 
lines in my script just to get the variables.  Maybe a module or 
something?  Any suggestions would be appreciated!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: conf files

2002-06-10 Thread Felix Geerinckx

on Mon, 10 Jun 2002 18:26:39 GMT, James Taylor wrote:

> I have this app I just wrote, and I wanted to give my users a more 
> 'standard' .conf file, 

Have you already looked at

?

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: conf files

2002-06-10 Thread Geoffrey F. Green

On 6/10/02 2:26 PM, "James Taylor" <[EMAIL PROTECTED]> wrote:

> You get the idea.  Anyway, I could make a file like this and then
> 'require' it I suppose, then run a regex on the lines and assign the
> variables THAT way, but I was curious if anyone could think of a better
> way to do this instead of forcing myself to make all these un-needed
> lines in my script just to get the variables.  Maybe a module or
> something?  Any suggestions would be appreciated!

Here are a few modules that simplify the creation/use of configuration
files. I've only played with some, so YMMV:

XML::Simple
http://www.web.co.nz/~grantm/cpan/index.html

Config::General
http://search.cpan.org/search?dist=Config-General

AppConfig
http://search.cpan.org/search?dist=AppConfig

Config::Simple
http://search.cpan.org/search?dist=Config-Simple

 - geoff


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: conf files

2002-06-11 Thread Langa Kentane

I recently played around with a module Config::General. Very handy. 
Try that.

> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]] 
> Sent: 10 June 2002 08:27 PM
> To: [EMAIL PROTECTED]
> Subject: conf files
> 
> 
> I have this app I just wrote, and I wanted to give my users a more 
> 'standard' .conf file, instead of forcing them to open up the script, 
> and dig through and change variables (Some people get confused by 
> this... Go figure).  SO, I wanted to give a .conf sort of like the 
> apache conf file where you'll see things like:
> 
> ENCRYPTION=1 
>   #Set this to 0 if you don't want encryption
> ENCTYPE=3DES 
>   # 3DES or BLOWFISH
> BASEDIR=/home/user 
> # Path to something
> 
> 
> ## Sockets #
> 
> PORT=1200 
>   # Port to connect to
> TYPE=TCP 
>   # TCP or UDP
> HOST=localhost 
>   # Hostname
> 
> 
> 
> You get the idea.  Anyway, I could make a file like this and then 
> 'require' it I suppose, then run a regex on the lines and assign the 
> variables THAT way, but I was curious if anyone could think 
> of a better 
> way to do this instead of forcing myself to make all these un-needed 
> lines in my script just to get the variables.  Maybe a module or 
> something?  Any suggestions would be appreciated!
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
NOTICE: This message and any attachments are confidential and intended
solely for the addressee. If you have received this message in error, please
notify the sender at Nanoteq (Pty) Ltd immediately, telephone number +27 (0)
12 672 7000. Any unauthorised use, alteration or dissemination is
prohibited. Nanoteq (Pty) Ltd accepts no liability whatsoever for any loss
whether it be direct, indirect or consequential, arising from information
made available and actions resulting there from.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]