Foreach Loop

Simple foreach loop syntax.

Perl in Action


foreachloop


Perl Code

Simple foreach loop syntax.

 
     
use strict;

my @arr = (1,2,3,4,5);

foreach (@arr)
{
  print $_ . "\n";
}
 

If you find this site useful and are a book buyer/reader...

Abe Books is one of my affiliates. I only use affiliates that I also purchase products from. I love Abe books. I have purchased many books from them originally cost $40 to $60 for as little as $5 to $10 dollars including shipping costs.

By accessing Abe books and clicking on one of my links I receive a small commission on your purchase that helps pay for this site. You pay no more for your books than if you accessed their site directly. Thanks for your support.

Click on icon to find books on Perl at Abe Books...

The Following are a list of Perl books I own

  • Perl Black Book by Steven Holzner
  • Programming Perl by Larry Wall
  • Advanced Perl Programming by Sviram Srinivasan
  • Algorithms with Perl by Jon Orwant
  • Perl DBI by Alligator Descartes
  • Mastering Regular Expressions by Jeffrey Friedl
  • Perl Cookbook by Tom Christiansen
  • Network Programming with Perl by Lincoln Stein
  • WIN32 Perl Programming by Dave Roth
  • Writing CGI Applications with Perl by Kevin Melltzer
  • mod_perl Developers Cookbook by Geoffrey Young
Free Shipping 125x125

Perl Code Examples

Anonymous Subroutines

Arrays

Loops











navTango.com free

75% of your donation

goes to charity.