Skip to content

Commit

Permalink
Allow for the possibility of empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Jun 16, 2023
1 parent 15b0011 commit 7fa779b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions util/extract_metadata
Expand Up @@ -16,14 +16,13 @@ foreach my $program ( @programs ) {

my( $extracted ) = $data =~ m/
^=begin \s+ metadata \s+
(.+\S)
\s+
(.+)
^=end \s+ metadata
/xms;

my %hash;
foreach my $line ( split /\R/, $extracted ) {
my( $field, $value ) = split /:\s+/, $line, 2;
my( $field, $value ) = split /:\s*/, $line, 2;
if( exists $hash{$field} and ! ref $hash{$field} ) {
$hash{$field} = [ $hash{$field}, $value ];
}
Expand Down

0 comments on commit 7fa779b

Please sign in to comment.