shadowline
Logical Operators << Data Lists >> Arrays
The best way to describe a list in Perl/CGI is a group of data. It is a sequence of values inclosed in parentheses.
(1,2,3,4,5)

Lists are not limited to numbers. Strings may also be included ...
(1,2,"hello",7,9,"world",42)

Scalar variables may also be used ...
(1,$name,5,34)
Whatever value $name holds will be placed in its spot when the list is being used.

A string continaing a scalar variable may also be used ...
(1,2,"Hello $name",78)

A list may be defined as an "empty list" ...
()

Lists may also hold expressions ...
(2+3,"hello",$value1*$value2,21)

Shortcuts may be used in lists by using two periods.
(1..10) Represents (1,2,3,4,5,6,7,8,9,10)
(1,5,7..10) Represents (1,5,7,8,9,10)
(2.5 .. 5.5) Represents (2.5,3.5,4.5,5.5)
(-2.5 .. 1.9) Represents (-2.5,-1.5,-0.5,1.5) Notice only the starting decimal factor is used.
(a..e) Represents (a,b,c,d,e)
(a..e,1..5) Represents (a,b,c,d,e,1,2,3,4,5)

Lists may be used as arrays.
@numbers = (1..10);
Logical Operators << Data Lists >> Arrays
shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow