http://www.perlmonks.org?node_id=1134693


in reply to Problem printing JSON type output

Hi jonathan.vanderwatt

Welcome to the monastery!

This little piece of code might help.

while (my $row = <$fh>) { chomp($row); next if $row =~ /^cd|^#|^$/; # skip lines $row =~ /xruntime\/([a-z0-9]+)_/; # regexp pattern matc +hing with memory () print "\t{ \"{#BOBINSTANCE}\":\"$1\"}\n"; # print memory regist +er $1 }