# Formatting question my $label = "content="; while(defined($textline=)) { next unless $textline=~/\S/; # ignore blank lines next if $textline=~/^\s*".*"\s*$/; # ignore message lines chomp($textline); #Extract keys in an output file my @try = $textline =~ /$label(.*?)\/(.*?)/g; for (@try) { print "{" . $_. . "," . "}"; } }