GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Object::Array::Plugin::Builtins(3) User Contributed Perl Documentation Object::Array::Plugin::Builtins(3)

Object::Array::Plugin::Builtins

See Object::Array.

Provides analogues to Perl's built-in array operations.

Returns the number of elements in the array.

"size" and "length" are synonyms.

  print $array->elem(0);
  print $array->[0];

Get a single element's value.

  $array->elem(1 => "hello");
  $array->[1] = "hello";

Set a single element's value.

"element" and "elem" are synonyms.

  print for $array->slice([ 0, 1, 2 ]);
  print for @{$array}[0,1,2];

Get multiple values.

  $array->slice([ 0, 1, 2 ] => [ qw(a b c) ]);
  @{$array}[0,1,2] = qw(a b c);

Set multiple values.

Shortcut for all values in the array.

"elements" and "elems" are synonyms.

NOTE: Using methods in a for/map/etc. will not do aliasing via $_. Use array dereferencing if you need to do this, e.g.

  $_++ for @{$array};

Erase the array. The following all leave the array empty:

  $array->size(0);
  $array->clear;
  @{ $array } = ();

As the builtin array operations of the same names.

Note that since map and grep are called as methods, you must use "<sub { }"> (no bare blocks).

2006-08-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.