http://qs321.pair.com?node_id=11122087


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 :)

  • Comment on Re: Unable to get the paragraph in the list of hashes. Getting single lines instead.
  • Download Code