in reply to Format script out in JSON for webpage

Add <pre> tags to your returned response:
print "<pre>$ns_lookup\n</pre>";
or (easier to read):
print $cgi->pre("$ns_lookup\n");

        This is not an optical illusion, it just looks like one.

Replies are listed 'Best First'.
Re^2: Format script out in JSON for webpage
by Your Mother (Archbishop) on Mar 11, 2016 at 00:40 UTC

    On this note, please everyone remember, unescaped HTML is on the keyring to your kingdom. Never ever, ever, ever, ever write a song about the Sibbie. Or forget to escape HTML.

    print $q->pre( $q->escapeHTML( $ns_lookup ) );
      Hi This does not seem to have worked the output is now
      <pre>google.co.zw. 21014 IN NS ns1.google.com. google.co.zw. 21014 IN +NS ns2.google.com. google.co.zw. 21014 IN NS ns3.google.com. google.c +o.zw. 21014 IN NS ns4.google.com.</pre>