Class-Struct-FIELDS
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
goto &Bob::__gg;
}
=head2 Private fields
Fields starting with a leading underscore, C<_>, are private: they are
still valid fields, but C<Class::Struct::FIELDS> does not create
subroutines to access them. Instead, you should access them the usual
way for hash members:
$self->{_private_key}; # ok
$self->_private_key; # Compilation error
See L<fields> for more details.
=head2 Extra magic: auto-stringify
If there exists a subroutine named C<as_string> at the time you invoke
C<struct> (or, equivalently, during the call to C<use>), then
C<Class::Struct::FIELDS> will glue that into auto-stringification with
C<overload> for you.
goto &Bob::__gg;
}
Private fields
Fields starting with a leading underscore, "_", are private: they are
still valid fields, but "Class::Struct::FIELDS" does not create
subroutines to access them. Instead, you should access them the usual
way for hash members:
$self->{_private_key}; # ok
$self->_private_key; # Compilation error
See the fields manpage for more details.
Extra magic: auto-stringify
If there exists a subroutine named "as_string" at the time you invoke
"struct" (or, equivalently, during the call to "use"), then
"Class::Struct::FIELDS" will glue that into auto-stringification with
"overload" for you.
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.505 second using v1.00-cache-2.02-grep-82fe00e-cpan-2cc899e4a130 )