Last active
May 19, 2018 00:22
-
-
Save glwinsor/3f696de1671bb421839f3348adaf800d to your computer and use it in GitHub Desktop.
[config file] Read simple config file (key=value pairs) and assign to hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: syntax=perl | |
my %CONF; | |
open my $configfile, '<', 'config.txt' or die $!; | |
while (<$configfile>) { | |
chomp; | |
my ( $key, @value ) = split( "=", $_ ); | |
$CONF{$key} = join '=', @value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment