Skip to content

Instantly share code, notes, and snippets.

@kizashi1122
Created January 9, 2018 08:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
use v5.18;
use Net::GitHub;
use Encode qw/encode_utf8/;
use DDP;
my @files = glob "release-*";
my %hash = ();
for my $f (@files) {
my %release = ();
open my $fh, '<' , $f or die $!;
my $key;
for my $line (<$fh>) {
$line =~ s/[\r|\n]//g;
if ($line =~ /^### (.+)/) {
$key = $1;
$release{$key} = [];
} elsif ($line =~ /^\- (.+)/) {
push(@{$release{$key}}, $1);
}
}
close $fh or die $!;
$hash{$f} = \%release;
}
p %hash;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment