in reply to Re: CGI form Not Showing Up. (Style Comment)
in thread CGI form Not Showing Up.

(Note: I haven't tested this code!)
You only want td() or th() elements directly inside of Tr() elements, otherwise the content will print out somewhere strange. this is closer:
#!/usr/bin/perl use CGI qw/:standard/; sub nl{ return qq(\n) } @ips = ("1.2.3.4","2.4.6.8","3.6.9.12"); @names = ("A1","B2","C3"); @services = ("srv1","srv2","srv3"); @banners = ("ban1.1","ban2.2","ban3.3"); print table( Tr([ td(br.br.b(u("IPS")." - @ips".br.br)).nl, td(br.br.b(u("Names")." - @names".br.br)).nl, td(br.br.b(u("Services")." - @services".br.br)).nl, td(br.br.b(u("Banners")." - @banners".br.br)).nl, ]).nl, ).nl;

Replies are listed 'Best First'.
Re: (3) CGI form Not Showing Up. (Style Comment)
by talexb (Chancellor) on May 01, 2002 at 18:51 UTC
    Good one, although I note that you're using concatenation rather than the more efficient list separator ('.' as opposed to ','). And what's the nl for?

    --t. alex

    "Nyahhh (munch, munch) What's up, Doc?" --Bugs Bunny

      ok the nl function is just ultimate laziness it's two characters shorter than "\n" and four shorter than qq(\n). i like new lines in my HTML. It should really be &nl so i don't have to define it up top.
      As for the concat, in this case it works same as , but if you use brackets
      td(["bob "."dan","alice"])
      to construct a row of td()'s it makes a big difference wheather you concat or commify. you get
      <td>bob dan</td><td>alice</td>
      So habitually i use . for things in one td cell. I doubt the overhead is noticible.