Array
More array basics including:
- Create an empty array
- Assigning a list to an array
- Assigning an array to an array
Perl in Action

Perl Code
Just cut-n-paste to reuse.
use strict;
my @x; #an empty array
my @y = (); #also an empty array
@x = (1,2); #assigning a list to an array
$x[2] = 3; #assigning an element to an array
#notice we refer to the array in scalar
#context
@y = @x; #assign an array to an array
my @z = ("a","b","c",1,2,"3",1+3,"1"+"3"); #declare array assign list
print ("@x ","@y ","@z "); #print list
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
|
 |