http://www.yyy.com/store/application/meraqf?origin=rrr.jsp&event=link(goto)&content=/asp/administrative/catalog/products/Network/benefits.jsp. #### my @dirtextfiles=(); while (<*>) { push (@textfiles,$_) if (-f "$_"); } #### # 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 "{" . $_. . "," . "}"; } }