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

this is wat i mean now

i want to get

<li> #Foo </li> <li> #bar </li> <li> #moo </li>
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";

Replies are listed 'Best First'.
Re^3: output div tag inside html
by Your Mother (Archbishop) on Sep 13, 2018 at 18:23 UTC

    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>

      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?.