bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

am trying to loop and get all arrays. every name with its li

<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> 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: output all array names in html
by marto (Cardinal) on Sep 14, 2018 at 12:27 UTC

      Hi marto,

      "am trying to loop and get all arrays. every name with its li"

      @names = ('Foo', 'Bar', 'Moo'); my $str = join(" ",@names);

      I think you are getting trolled, now.


      The way forward always starts with a minimal test.

        Could be, or just copying/pasting code without understanding it, or even trying to.

      ya i know that. but tried it and fail just outputing all names in same li not every name with its li

        "ya i know that. but tried it and fail just outputing all names in same li not every name with its li"

        You can't have tried. This doesn't do what your code does, which is why I posted it. Ignoring advice and not trying what you've been given doesn't seem to be working out well for you. You should read an understand How do I post a question effectively?, and all the other links I've given you to date.