in reply to looping through array
foreach my $loop_variable (@data_array) { print $loop_variable; }
or this:
foreach (@data_array) { print $_; }
As a side note, see how all your array elements are links? That is because you did not wrap your code in <code> tags. See Writeup Formatting Tips.
2) You are not declaring array elements so much as defining strings and storing those in your array. Your syntax will work so long as you have a comma separated list of strings. That means you can use pairs of single quotes, pairs of double quotes or any of a host of delimiters listed in Quote and Quote like Operators. For your case, you may be particularly interested in the qw() delimiter, since that uses whitespace to delimit your strings instead of commas.
|
|---|