PerlBean::Symbol - Symbol in a Perl bean
use strict; use PerlBean; use PerlBean::Attribute::Factory; my $bean = PerlBean->new( { package => 'MyPackage', } ); my $factory = PerlBean::Attribute::Factory->new(); my $attr = $factory->create_attribute( { method_factory_name => 'true', short_description => 'something is true', } ); $bean->add_method_factory($attr); use IO::File; -d 'tmp' || mkdir('tmp'); my $fh = IO::File->new('> tmp/PerlBean.pl.out'); $bean->write($fh);
Symbol in a Perl bean
PerlBean::Symbol allows to specify, declare, assign an export a symbol from a PerlBean.
PerlBean::Symbol
PerlBean
Creates a new PerlBean::Symbol object. OPT_HASH_REF is a hash reference used to pass initialization options. On error an exception Error::Simple is thrown.
OPT_HASH_REF
Error::Simple
Options for OPT_HASH_REF may include:
assignment
Passed to set_assignment().
comment
Passed to set_comment().
declared
Passed to set_declared(). Defaults to 1.
description
Passed to set_description().
export_tag
Passed to set_export_tag(). Must be an ARRAY reference.
ARRAY
symbol_name
Passed to set_symbol_name().
volatile
Passed to set_volatile().
Add additional values on the list of tags with which the symbol is exported. NOTE: The default tag lets the symbol be exported by default. ARRAY is the list value. The addition may not yield to multiple identical elements in the list. Hence, multiple occurrences of the same element cause the last occurrence to be inserted. On error an exception Error::Simple is thrown.
default
Delete elements from the list of tags with which the symbol is exported. NOTE: The default tag lets the symbol be exported by default. Returns the number of deleted elements. On error an exception Error::Simple is thrown.
Returns the count of items in ARRAY that are in the list of tags with which the symbol is exported. NOTE: The default tag lets the symbol be exported by default.
Returns the value assigned to the symbol during declaration.
Returns the comment for the symbol declaration.
Returns the description of the symbol.
Returns the symbol's name (e.g. $var or @list).
$var
@list
Returns whether the symbol is to be declared with our or not.
our
Returns whether the symbol is volatile or not.
Set the value assigned to the symbol during declaration. VALUE is the value. On error an exception Error::Simple is thrown.
VALUE
Set the comment for the symbol declaration. VALUE is the value. On error an exception Error::Simple is thrown.
State that the symbol is to be declared with our. VALUE is the value. Default value at initialization is 1. On error an exception Error::Simple is thrown.
1
Set the description of the symbol. VALUE is the value. On error an exception Error::Simple is thrown.
Set the list of tags with which the symbol is exported. NOTE: The default tag lets the symbol be exported by default absolutely. ARRAY is the list value. Each element in the list is allowed to occur only once. Multiple occurrences of the same element yield in the last occurring element to be inserted and the rest to be ignored. On error an exception Error::Simple is thrown.
Set the symbol's name (e.g. $var or @list). VALUE is the value. On error an exception Error::Simple is thrown.
State that the symbol is volatile. VALUE is the value. On error an exception Error::Simple is thrown.
Returns an ARRAY containing all values of the list of tags with which the symbol is exported. NOTE: The default tag lets the symbol be exported by default.
Writes the code for the symbol. FILEHANDLE is an IO::Handle object.
FILEHANDLE
IO::Handle
PerlBean, PerlBean::Attribute, PerlBean::Attribute::Boolean, PerlBean::Attribute::Factory, PerlBean::Attribute::Multi, PerlBean::Attribute::Multi::Ordered, PerlBean::Attribute::Multi::Unique, PerlBean::Attribute::Multi::Unique::Associative, PerlBean::Attribute::Multi::Unique::Associative::MethodKey, PerlBean::Attribute::Multi::Unique::Ordered, PerlBean::Attribute::Single, PerlBean::Collection, PerlBean::Dependency, PerlBean::Dependency::Import, PerlBean::Dependency::Require, PerlBean::Dependency::Use, PerlBean::Described, PerlBean::Described::ExportTag, PerlBean::Method, PerlBean::Method::Constructor, PerlBean::Method::Factory, PerlBean::Style
None known (yet.)
First development: March 2003 Last update: September 2003
Vincenzo Zocca
Copyright 2003 by Vincenzo Zocca
This file is part of the PerlBean module hierarchy for Perl by Vincenzo Zocca.
The PerlBean module hierarchy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
The PerlBean module hierarchy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the PerlBean module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
To install PerlBean, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlBean
CPAN shell
perl -MCPAN -e shell install PerlBean
For more information on module installation, please visit the detailed CPAN module installation guide.