Instantly share code, notes, and snippets.

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