NAME

Data::Pointer::ARRAY - The cARRAY pointer type

SYNOPSIS

	use Data::Pointer qw(ptr);
  
	my $var = [ qw( a list of words ) ];
	my $ptr = ptr( $var );

	print $ptr->plus(1)->deref;           # listofwords
	print scalar $ptr->plus(1)->deref;    # list

	$ptr->deref = "foo";                  # $var->[0] eq 'foo'

DESCRIPTION

The ARRAY pointer type behaves in a very simliar way to 'arrays' in C. The pointer points to inidividual elements of the array and can be incremented and dereferenced as one would expect.

METHODS

assign($array_ref)

Assign the pointer to a different value

p = val
deref

Dereference the pointer or assign to the value it's pointing to

*p
*p = val
incr([$num])

Increments the position of the pointer (default is 1)

p++
decr([$num])

Decrements the position of the pointer (default is 1)

p--
plus($num)

Return a pointer by the given offset

p + 1
minus($num)

Return a pointer by the given offset

p - 1

AUTHOR

Dan Brook <broquaint@hotmail.com>