How do i print out an array in perl?



  • Note: later versions of perl you can use "say" to do the printing.

    @animals = ("lion", "tiger", "bear", "monkey");
    print "These are the animals are a part of our world, @animals\n"
    

    Result is:
    These are the animals are a part of our world, lion tiger bear monkey


Log in to reply
 

© Lightnetics 2024