in reply to Read file and remove whitespace

Hi,

Since someone already explained about the regex, I just thought I would mention another possibility for you.

I had an application which did something similar to what it looks like you are doing here. I found it simpler to turn the config.txt into a config.pm which could then be 'used' or 'required'. The list of "var=val" was turned into a hash, and that hash took the place of the %values hash that you are building by hand.

Thus no need to write a something to parse it up, and it would allow any level of complexity that can be set up in a hash. This fact allowed the code to grow as new features were added to the system.

Sincerely,
Sifmole

Replies are listed 'Best First'.
Re: Re: Read file and remove whitespace
by grim (Initiate) on May 02, 2001 at 06:14 UTC
    I am doing something similiar to this. I am reading the file from a module and turning it into a hash. However I want the ability to edit the config file via web form and I thought this would make it simple and easy. Thanks for the suggestion though

    Chris