NAME
Class::MakeMethods::Template::Scalar - Methods for blessed scalars
SYNOPSIS
package MyObject;use Class::MakeMethods::Template::ExternalData (new => 'new',scalar => 'foo',);package main;my $obj = MyObject->new( foo => "Foozle" );print $obj->foo(); # Prints Foozle$obj->foo("Bamboozle"); # Sets $$objprint $obj->foo(); # Prints Bamboozle
DESCRIPTION
Supports the Generic object constructor and accessors meta-method types, but uses scalar refs as the underlying implementation type, so only one accessor method can be used effectively.
Standard Methods
The following methods from Generic are all supported:
newscalarstringstring_indexnumberbooleanbitsarrayhashtiedhashhash_of_arraysobjectinstancearray_of_objectscodecode_or_scalar
See Class::MakeMethods::Template::Generic for the interfaces and behaviors of these method types.
However, note that due to special nature of this package, all accessor methods reference the same scalar value, so setting a value with one method will overwrite the value retrieved by another.