Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ini file module/script?

Status
Not open for further replies.

Tve

Programmer
Joined
May 22, 2000
Messages
166
Location
FR
I'm still quite new at perl, but the scripts I write are used in several different offices. In each location, a few varaibles, eg: server name, can vary.

To avoid modifying the script for every office, I'm looking for a standard format to store information on the location. The script could access this information and thus stay generic.

This is a sort of INI format like used by Windows.

Does anyone know of a module/script this exists to read/write in this format?

Does anyone have other suggestions?

Thanks,

Thierry
 
Thierry,

I'm not aware of a standard (CPAN) module but you're welcome to the routines I use if you wish?
Mike
michael.j.lacey@ntlworld.com
 
Mike,

Thanks for the offer.

I would be very pleased to try your scripts.

My e-mail address: thierry.vermeersch@nl.abb.com


Thierry
 
There is a module for reading and writing INI files.
its part of the Win32::AdminMisc module.

i think there's Win32::AdminMisc::ReadINI()

and Win32::AdminMisc::WriteINI()

and i think there's even a tie ini.
 
Win32 ties you to the NT platform though...... (yuk)
Mike
michael.j.lacey@ntlworld.com
 
The easiest way to do this is to define the variables that change in a separate .pl file and "require" it into the module. Then you can just change the variable values in that one small file. I do this for configuration values all the time.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top