Use for loop to output all elements in an array : For « Statement « Perl

Perl
1. Array
2. CGI
3. Class
4. Data Type
5. Database
6. File
7. GUI
8. Hash
9. Language Basics
10. Network
11. Regular Expression
12. Report
13. Statement
14. String
15. Subroutine
16. System Functions
17. Win32
18. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Perl » Statement » For 
Use for loop to output all elements in an array
    

@array = ("one""two""three");
for ($loop_index = 0; $loop_index <= $#array; $loop_index++
{
    print $array[$loop_index" ";
}

   
    
    
    
  
Related examples in the same category
1. A program that prints the numbers from 1 to 5 using the for statement.
2. Create an infinite loop using a for loop:
3. Here is an example of the for loop
4. Initialization, test, and increment, decrement of counters is done in one step
5. Loop Control Statements
6. Looping through an array with the for repetition structure
7. Nested for loop
8. Put more than one statement first and third part of for statement
9. Reference array length in for loop
10. Reference for loop control variable
11. Standard for structure: Loops 5 times, printing the multiples of 5 from 0-20
12. Sums the numbers from 1 to a specified number and also sums the even numbers.
13. The for Loop
14. The or part allows for a statement to be executed if the main part fails.
15. Use for loop to output the element one by one in an array
16. Uses the for statement to read four input lines and write three of them.
17. Using block labels with next.
18. Using for loop to sum the total
19. Using my inside for statement
20. Using nested for loop to assign value to two dimensional array
21. Using nested for loop to output the elements in a two-dimensional array
22. You can use a for loop to loop for a specific number of times.
23. Mixed diamond operator with for loop condition
24. Mixed diamond operator with for loop condition 2
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.