Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Perl
Array 238 codes
Home
Perl
Array
1 $# is the array size
2 $#questions is the index of the highest element in the @questions array
3 $s = pop @{[@a]}
4 A program containing overlapping array slices
5 A program that assigns a list as part of another list
6 A program that assigns to an array slice
7 A program that copies an array and compares the elements of the two arrays
8 A program that demonstrates the use of an array slice
9 A program that prints every element of an array
10 A program that prints the elements of a list
11 A program that reads data into an array and writes the array
12 A program that sorts an array
13 A program that uses an array variable as an array-slice subscript
14 A three-dimensional array
15 Access array element by index
16 Accessing Elements
17 Accessing List Values
18 Add elements to @array by referring to nonexistent element 3
19 Adding a hash to the array
20 Adding array items from one array to another array
21 Adding more elements to an array
22 Adding to an Array
23 Adding two arrays together
24 An array is a named list
25 An array is an ordered list of scalars
26 An array on the left of a list assignment receives all remaining initializers in the list on the right side of a list assignment
27 An empty list is represented as parentheses with nothing in between
28 Append to array
29 Append two arrays to form another array
30 Array Elements
31 Array Elements Assigned to a Slice
32 Array index in action
33 Array literal
34 Array of array
35 Array of Hashes
36 Array Slices
37 Array slices 2
38 Arrays
39 Arrays in Perl
40 ASCII and Numeric Sort Using Subroutine
41 Assign array value to a list of scalar variables
42 Assign array variable to scalar variable
43 Assign returning array value from a function to an array
44 Assigning An Array To A Scalar
45 Assigning an array value to a scalar variabe
46 Assigning one array variable to another variable
47 Binary search of an array
48 Build 4-element array, each with references to another array
49 Build a string array across two lines
50 Change array length by adding new element to an array
51 Change array length by assigning new length to an array
52 Change value in an array
53 Character and Number Sorts
54 Chop and chomp Functions with Lists
55 Construct a string array and output its first element
56 Construct an integer array and output its first element
57 Constructing and Dereferencing
58 Convert array to scalar
59 Create @array with one element by referring to nonexistent element 0
60 Create array with range operator
61 Create lists of number variables
62 Create lists of text variables
63 Creating and initializing an array with list assignment
64 Define an array variable called @myList
65 Define two dimensional array
66 Delete all remaining elements
67 Dereferenced array
68 Determine the mean
69 Directly indexing an arrays contents
70 Discard words until we see the A marker
71 Displaying slices of @array
72 Double each element of an array
73 Duplicate array elements
74 Empty list
75 Exists function returns true if an array index (or hash key) has been defined, and false if it has not
76 Filling an array with 100 zeroes by using the x operator
77 Filling an array with a sequence of numbers by using the operator
78 Get array element by index
79 Get array last element
80 Get array last index
81 Get array length
82 Get the array length by assigning the array variable to a scalar variable
83 Get the return value of reverse function
84 Get two variables from array
85 How to use two dimensional arrays
86 Increase the number of elements to 11
87 Index an array
88 Join array
89 Joining each element of a list with a newline
90 Linear search of an array
91 Lists Assigned to Arrays
92 Lists of Lists
93 Loop through a list
94 Loop through the array and replace every undefined value with an actual value
95 Map to an array
96 Mix data type in an array
97 Mixed Data Assigned to Array Cells
98 Mixed Lists
99 Modify individual elements, using the syntax ${$reference}[$element]
100 Months Of The Year
101 Mulitple indexing
102 Multidimensional Arrays(Lists of Lists)
103 Multiple Elements Of A List
104 Numeric sort
105 Output all elements in an array with print command
106 Output nested array
107 Output the last element in the array
108 Output the number of elements and the last index number
109 Output the value of an array reference
110 Output the whole array in print
111 Output two -dimensional array
112 Paper Stacks
113 Pass user-defined function to sort function
114 Perform list assignments and display results
115 Place scalar variables in lists and arrays
116 Pop value out of array
117 Print @{[uc(hello)]} there n
118 Print an element in a list of variables
119 Print each value in the array
120 Print function with sort and customized sorting function
121 Print function with sort and customized sorting function in a descending order
122 Program to demonstrate a pointer to a two-dimensional array
123 Push array and join
124 Push array into an array
125 Push one array to another array
126 Push value from one array to another array
127 Push value into an array
128 Push value to an array
129 Push value to array
130 Push, pop, shift and unshift an array
131 Put one array into another array as an element
132 Put one array into itself
133 Reducing the number of elements to 6
134 Reference a dereferenced array by index
135 Reference array element by index
136 Reference Counting and Destruction
137 Reference more than one elements in an array at the same time
138 Reference negative array index
139 Reference single array element by using the $ not @
140 Reference the outter array of an two dimensional array
141 Reference two arrays in foreach statement
142 References to Simulate Multi-Dimensional Arrays
143 Remove elements from array with splice
144 Remove elements from position 7 onward
145 Remove first element only and save it
146 Remove last three elements
147 Removing 3 elements, beginning with element 15 of @array
148 Removing all elements from element 8 to the end of @array
149 Removing all elements in the array
150 Replace the second and third elements
151 Replacing part of @array with the elements from @array2
152 Reverse a sub-range of an array
153 Reverse an array and a list
154 Running through Arrays
155 Scalar Data in an Array
156 Shift and Unshift
157 Shift array
158 Shift value from array
159 Slice an array by referencing the index in a sub range
160 Slicing out part of an array to make a sort of subarray
161 Sort a string array
162 Sort an integer array
163 Sort in action
164 Sorts
165 Special Scalars and Array Assignment
166 Splice two arrays
167 Splice(@array, 2, 0, three)
168 Splice(@array, 2, 1, @array2)
169 Splicing and replacing elements of a list
170 Split a scalar to create a list
171 Store various type values in an array
172 String array
173 Sum values in an array
174 The Array Size Indicator
175 The delete function removes a value from an element of an array but not the element itself
176 The join function joins the elements of an array into a single string
177 The List Separator Variable
178 The pop function pops off the last element of an array and returns it
179 The push function pushes values onto the end of an array, thereby increasing the length of the array
180 The reverse command reverses the order of the elements in a list, returning the new list
181 The reverse function reverses the elements in an array
182 The shift function shifts off and returns the first element of an array, decreasing the size of the array by one element
183 The sort command sorts an array
184 The sort function sorts and returns a sorted array
185 The splice function removes and replaces elements in an array
186 The unshift function prepends LIST to the front of the array
187 Totalling a List
188 Two dimensional array is array of array
189 Two dimensional array is array scalar plus array
190 Unshift array
191 Unshift places data to the front of an array
192 Update part of an array by referencing only a sub range
193 Use a scalar variable as our subscript
194 Use reverse on arrays as well as lists
195 Use strict with two dimensional array
196 Using - to reference value in an array reference variable
197 Using @ operator and one dimensioanal array to create two dimensioanl array
198 Using @array as a condition
199 Using = operator in array sort function
200 Using a $#array variable in a loop
201 Using a minus variable as the array index
202 Using an Inline Function to Sort a Numeric List
203 Using array length in for loop
204 Using array operator to reference variable in an array
205 Using array reference to create two-dimensional array
206 Using array reference to index the two dimensional array
207 Using array reference variable to get the element value
208 Using array reference with two-dimensional array
209 Using array variable name as the reference to that array
210 Using Arrays as an Indexed List
211 Using Arrays as Stacks
212 Using cmp in array sort customized function
213 Using dereferenced array in foreach loop
214 Using for each with $_ variable
215 Using for loop with array
216 Using foreach to change the value in an array
217 Using join function to add separator
218 Using multi-dimensional array references
219 Using multi-dimensional array references again
220 Using negative subscripts to access elements from the end of the array
221 Using nested for loop to initialize two-dimensional array
222 Using Pop to remove element from an array
223 Using push to insert elements at the end of @array
224 Using qw to construct a string array
225 Using reverse function in print statement
226 Using reverse in if statement
227 Using reverse with and constant range
228 Using reverse with letter based range
229 Using scalar function to get the array length
230 Using shift the get value out of an array
231 Using sort function in print statement
232 Using splice to delete words
233 Using splice to insert array elements
234 Using the - to reference the elements of a two-dimensional array
235 Using the backslash operator on arrays
236 Using two-dimensional array
237 Using unshift to insert elements at the front of @array
238 While there are more elements in @array, remove each element with shift