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 reply to Re: Unable to get the paragraph in the list of hashes. Getting single lines instead.
by tybalt89
in thread Unable to get the paragraph in the list of hashes. Getting single lines instead.
by pritesh_ugrankar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |