Skip to content

Instantly share code, notes, and snippets.

@tene
Created December 19, 2010 00:01
Show Gist options
  • Select an option

  • Save tene/746991 to your computer and use it in GitHub Desktop.

Select an option

Save tene/746991 to your computer and use it in GitHub Desktop.
[sweeks@sweeks-laptop ~]$ perl /tmp/config.pl
$VAR1 = {
'bar' => '2',
'omg' => '29',
'lol' => '3',
'foo' => '1'
};
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %config = map { $_ =~ m/^(.+): (\d+)/ } <DATA>;
print Dumper(\%config);
__DATA__
foo: 1
bar: 2
lol: 3
omg: 29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment