Tacoen's shared code-snipsets
sub IniLoad { # my %ini = &IniLoad("/where/is/file.ini"); # print $ini{"section:field"}; my $file=shift; my %ini; my @INI = &tacoenf::load_as_array($file); for $l(@INI) { $l=tacoenf::notrail($l); if ($l=~/^\[(.*)\]/) { $vsection = $l; $vsection =~ s/^\[(.*)\]$/$1/ie; } next if ($l eq ""); next if ($l=~/^\[(.*)\]/); my $value=$vkey=$l; $vkey =~ s/(.*)\=(.*)/$1/gie; $vkey=tacoenf::trim($vkey); $value=~ s/(.*)\=(.*)/$2/gie; $value=tacoenf::trim($value); $ini{"$vsection:$vkey"} = $value; } return %ini } #A Shortcut sub IniRead { my($file,$section,$key)=@_; my %ini = &IniLoad("where/is/file.ini"); return $ini{"$section:$key"}; }require tacoen.pm