"Sputnik" help  
Sputnik Help
Language Reference - Operators - Operator [] (Append To End Of Array)

Operator [] (Append To End Of Array)

Append to end of array. e.g.

my $array = array("One", "Two", "Three");
$array[] = "Four";
$array[] = "Five";
printr($array);
// PRINTS
// Array
// (
//     [0] => One
//     [1] => Two
//     [2] => Three
//     [3] => Four
//     [4] => Five
// )

It can also be used to access an index for example you use it on a string like:

my $str = "Cat";
say $str[0]; // C
$str[0] = "Z";
$str[1] = "p";
say $str; // Zpt

On an array it works like so:

my $array= array();
$array[0] = "Cat";
$array[99] = "Dog";
$array["FoX"] = "Uber";
printr $array;

To more more about it's use on Arrays go here.

It is also used to splice Arrays learn about that here.

To see a list of all the operators go here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org