in reply to Reading from an INI file

Hashes are much better here! Main reason: you don't want to pollute your namespace with names that can pop up in those INI files. Well, actually, you want it now, but after some experience with the results, you will want that you didn't want it now. {grin}

With an example:

my %ini; @file = grep m/^[^#]/, @file; #skips comments for (@file){ chomp; #mpolo is right! my ($key, $val) = split /=/,2; #splits the line $ini{ $key } = $val if $key; #if we have a key, store }
In the remainder of the code, use $ini{$key} to access the ini values.

You can read up in perldata.

Hope this helps,

Jeroen
"We are not alone"(FZ)