in reply to Unable to get the paragraph in the list of hashes. Getting single lines instead.
It's really logically a one-liner
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11121971 use warnings; my @answer = grep %$_, # ignore empty hashs map +{ /^\h*(.*?)\h*= (.*)/gm }, # convert a paragraph to anon hash + by lines do { local $/ = ''; <DATA> }; # get list of paragraphs use Data::Dump 'dd'; dd \@answer; __DATA__ ..... data section same as my other example .....
( Shown on multiple lines with comments added to avoid annoying GrandFather :)
|
---|
In Section
Seekers of Perl Wisdom