in reply to Re^2: output div tag inside html
in thread output div tag inside html

You can’t get pretty printing today without hoops. Hoops == code smell. This prints what you want without spacing. Templates or HEREDOCs are better by far for what you want; as I think might have already been mentioned. Maybe. :P

use strict; use CGI ":standard"; my @names = ('Foo', 'Bar', 'Moo'); print li([ map "#$_", @names ]); __END__ <li>#Foo</li> <li>#Bar</li> <li>#Moo</li>

Replies are listed 'Best First'.
Re^4: output div tag inside html
by bigup401 (Pilgrim) on Sep 13, 2018 at 21:34 UTC

    i dont mean to print the li only as u see my script is to print the whole li inside li there is div as u see example

    when u run the script u will see the output

    i just want to output the whole

    i want to get <li> #Foo with all div and span inside here </li> <li> #bar with all div and span inside here </li> <li> #moo with all div and span inside here </li> [download] use CGI::Pretty ":standard"; @names = ('Foo', 'Bar', 'Moo'); my $str = join(" ",@names); $data = li ( div({"class='inforno'"}, "<img src='inforno>'"), div({"class='inforno'"}, "<a href='#' class='inforno'>$str< +/a>"), span({"class='inforno'"}, "<a href='#' class='inforno'> Edit user </a>") ); print "$data\n";

      This is drastic update from what you posted before you edited it:

      "lol i dont mean to print the li only as u see my script is to print the whole li inside li there is div as u see example LOL"

      How do I change/delete my post?.

        ok am deleting it and re-post