Unix and Linux Discussions Tagged with perl array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
3 |
8,130 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
3,424 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,862 |
Programming |
|
|
|
10 |
2,818 |
Shell Programming and Scripting |
|
|
|
5 |
2,873 |
Shell Programming and Scripting |
|
|
|
1 |
2,219 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
7,973 |
Shell Programming and Scripting |
|
|
|
2 |
2,599 |
Shell Programming and Scripting |
|
|
|
5 |
1,683 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
3,188 |
Shell Programming and Scripting |
|
|
|
2 |
2,469 |
Shell Programming and Scripting |
|
|
|
3 |
26,777 |
Shell Programming and Scripting |
|
|
|
3 |
15,986 |
Shell Programming and Scripting |
|
|
|
5 |
11,194 |
Shell Programming and Scripting |
|
|
|
2 |
3,008 |
Programming |
JE::Object::Array(3pm) User Contributed Perl Documentation JE::Object::Array(3pm)
NAME
JE::Object - JavaScript Array object class
SYNOPSIS
use JE;
use JE::Object::Array;
$j = new JE;
$js_array = new JE::Object::Array $j, 1, 2, 3;
$perl_arrayref = $js_array->value; # returns [1, 2, 3]
$js_array->[1]; # same as $js_array->value->[1]
"$js_array"; # returns "1,2,3"
DESCRIPTION
This module implements JavaScript Array objects.
The "@{}" (array ref) operator is overloaded and returns a tied array that you can use to modify the array object itself. The limitations
and caveats mentioned in "JE::Object/"USING AN OBJECT AS A HASH"" apply here, too.
METHODS
See JE::Types for descriptions of most of the methods. Only what is specific to JE::Object::Array is explained here.
$a = JE::Object::Array->new($global_obj, @elements)
$a = JE::Object::Array->new($global_obj, $length)
$a = JE::Object::Array->new($global_obj, @elements)
This creates a new Array object.
If the second argument is an unblessed array ref, the elements of that array become the elements of the new array object.
If there are two arguments and the second is a JE::Number, a new array is created with that number as the length.
Otherwise, all arguments starting from the second one become elements of the new array object.
$a->value
This returns a reference to an array. This is a copy of the Array object's internal array. If you want an array through which you can
modify the object, use @$a.
SEE ALSO
JE
JE::Types
JE::Object
perl v5.14.2 2012-03-18 JE::Object::Array(3pm)