in reply to output all array names in html

use strict; use warnings; my @names = qw(Foo Bar Baz); for (@names){ print "$_\n"; }

Adapt as you see (un)fit. You'd be doing yourself a great favour if you spent time reading Tutorials->Getting Started with Perl, perlintro.

Replies are listed 'Best First'.
Re^2: output all array names in html
by 1nickt (Canon) on Sep 14, 2018 at 14:21 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.

        without understanding it, or even trying to
        Then that's even more a good reason not to waste any more time with this brick.


        holli

        You can lead your users to water, but alas, you cannot drown them.
Re^2: output all array names in html
by bigup401 (Pilgrim) on Sep 14, 2018 at 12:32 UTC

    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.

        i mean i tried it in my own way using foreach and while. but failed to work the way i want it to.