Miscellany
public text v1 · immutablemy %options;
my $sectionOptions;
my $currentSection;
while(my $line = <>){
if($line =~ /^\[(.+)\]$/){
if(defined $sectionOptions){
$options{$currentSection} = $sectionOptions;
$sectionOptions = {};
}
$currentSection = $1;
} elsif($line =~ /^(.+?)=(.+?)$/){
$sectionOptions->{$1} = $2;
}
}