class file has wrong version 50.0
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3009
Class::StrongSingleton 0.02
Class::StrongSingleton is a stronger and more secure Singleton base class. more>>
Class::StrongSingleton is a stronger and more secure Singleton base class.
SYNOPSIS
package My::Singleton::Class;
use base qw(Class::StrongSingleton);
sub new {
my ($class, %my_params) = @_;
# create our object instance
my $instance = { %my_params };
bless($instance, $class);
# and initialize it as a singleton
$instance->_init_StrongSingleton();
return $instance;
}
1;
# later in your code ...
# create the first instance of our class
my $instance = My::Singleton::Class->new(param => "value");
# try to create a new one again, and
# you end up with the same instance, not
# a new one
my $instance2 = My::Singleton::Class->new(param => "other value");
# calling instance returns the singleton
# instance expected
my $instance3 = My::Singleton::Class->instance();
# although rarely needed, if you have to
# you can destroy the singleton
# either through the instance
$instance->DESTROY();
# or through the class
My::Singleton::Class->DESTROY();
# of course, this is assuming you
# did not override DESTORY yourself
# Also calling instance before calling new
# will returns a new singleton instance
my $instance = My::Singleton::Class->instance();
This module is an alternative to Class::Singleton and Class::WeakSingleton, and provides a more secure Singleton class in that it takes steps to prevent the possibility of accidental creation of multiple instances and/or the overwriting of existsing Singleton instances. For a detailed comparison please see the "SEE ALSO" section.
Here is a description of how it all works. First, the user creates the first Singleton instance of the class in the normal way.
my $obj = My::Singleton::Class->new("variable", "parameter");
This instance is then stored inside a lexically scoped variable within the Class::StrongSingleton package. This prevents the variable from being accessed by anything but methods from the Class::StrongSingleton package. At this point as well, the new method to the class is overridden so that it will always return the Singleton instance. This prevents any accidental overwriting of the Singleton instance. This means that any of the follow lines of code all produce the same instance:
my $instance = $obj->instance();
my $instance = My::Singleton::Class->instance();
my $instance = $obj->new();
my $instance = My::Singleton::Class->new();
Personally, I see this an an improvement over the usual Gang of Four style Singletons which discourages the use of the new method entirely. Through this method, a user can be able to use the Singleton class in a normal way, not having to know its actually a Singleton. This can be handy if your design changes and you no longer need the class as a Singleton.
<<lessSYNOPSIS
package My::Singleton::Class;
use base qw(Class::StrongSingleton);
sub new {
my ($class, %my_params) = @_;
# create our object instance
my $instance = { %my_params };
bless($instance, $class);
# and initialize it as a singleton
$instance->_init_StrongSingleton();
return $instance;
}
1;
# later in your code ...
# create the first instance of our class
my $instance = My::Singleton::Class->new(param => "value");
# try to create a new one again, and
# you end up with the same instance, not
# a new one
my $instance2 = My::Singleton::Class->new(param => "other value");
# calling instance returns the singleton
# instance expected
my $instance3 = My::Singleton::Class->instance();
# although rarely needed, if you have to
# you can destroy the singleton
# either through the instance
$instance->DESTROY();
# or through the class
My::Singleton::Class->DESTROY();
# of course, this is assuming you
# did not override DESTORY yourself
# Also calling instance before calling new
# will returns a new singleton instance
my $instance = My::Singleton::Class->instance();
This module is an alternative to Class::Singleton and Class::WeakSingleton, and provides a more secure Singleton class in that it takes steps to prevent the possibility of accidental creation of multiple instances and/or the overwriting of existsing Singleton instances. For a detailed comparison please see the "SEE ALSO" section.
Here is a description of how it all works. First, the user creates the first Singleton instance of the class in the normal way.
my $obj = My::Singleton::Class->new("variable", "parameter");
This instance is then stored inside a lexically scoped variable within the Class::StrongSingleton package. This prevents the variable from being accessed by anything but methods from the Class::StrongSingleton package. At this point as well, the new method to the class is overridden so that it will always return the Singleton instance. This prevents any accidental overwriting of the Singleton instance. This means that any of the follow lines of code all produce the same instance:
my $instance = $obj->instance();
my $instance = My::Singleton::Class->instance();
my $instance = $obj->new();
my $instance = My::Singleton::Class->new();
Personally, I see this an an improvement over the usual Gang of Four style Singletons which discourages the use of the new method entirely. Through this method, a user can be able to use the Singleton class in a normal way, not having to know its actually a Singleton. This can be handy if your design changes and you no longer need the class as a Singleton.
Download (0.006MB)
Added: 2007-06-19 License: Perl Artistic License Price:
858 downloads
Class::Interfaces 0.04
Class::Interfaces is a Per module for defining interface classes inline. more>>
Class::Interfaces is a Per module for defining interface classes inline.
SYNOPSIS
# define some simple interfaces
use Class::Interfaces (
Serializable => [ pack, unpack ],
Printable => [ toString ],
Iterable => [ iterator ],
Iterator => [ hasNext, next ]
);
# or some more complex ones ...
# interface can also inherit from
# other interfaces using this form
use Class::Interfaces (
BiDirectionalIterator => {
isa => Iterator,
methods => [ hasPrev, prev ]
},
ResetableIterator => {
isa => Iterator,
methods => [ reset ]
},
# we even support multiple inheritance
ResetableBiDirectionalIterator => {
isa => [ ResetableIterator, BiDirectionalIterator ]
}
);
# it is also possible to create an
# empty interface, sometimes called
# a marker interface
use Class::Interfaces (
JustAMarker => undef
);
This module provides a simple means to define abstract class interfaces, which can be used to program using the concepts of interface polymorphism.
<<lessSYNOPSIS
# define some simple interfaces
use Class::Interfaces (
Serializable => [ pack, unpack ],
Printable => [ toString ],
Iterable => [ iterator ],
Iterator => [ hasNext, next ]
);
# or some more complex ones ...
# interface can also inherit from
# other interfaces using this form
use Class::Interfaces (
BiDirectionalIterator => {
isa => Iterator,
methods => [ hasPrev, prev ]
},
ResetableIterator => {
isa => Iterator,
methods => [ reset ]
},
# we even support multiple inheritance
ResetableBiDirectionalIterator => {
isa => [ ResetableIterator, BiDirectionalIterator ]
}
);
# it is also possible to create an
# empty interface, sometimes called
# a marker interface
use Class::Interfaces (
JustAMarker => undef
);
This module provides a simple means to define abstract class interfaces, which can be used to program using the concepts of interface polymorphism.
Download (0.006MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1115 downloads
Class::Driver 0.005
Class::Driver is a Perl module to generate driver (composite) class hierarchies on-the-fly. more>>
EXAMPLE
# This is a really long synopsis, but hopefully it will give you an idea...
package MyPackage;
use Class::Driver;
use base q(Class::Driver);
our %drivers;
return 1;
sub new {
my($class, %args) = @_;
die "mime_type is required" unless($args{mime_type});
die "no driver to handle type $args{mime_type}"
unless($drivers{$args{mime_type}});
return $class->driver_load($drivers{$args{mime_type}}, %args);
}
sub driver_new {
my($class, %args) = @_;
return bless %args, $class;
}
sub driver_required { 1; }
sub driver_requied_here { 0; }
package MyPackage::avi;
use MyPackage;
use base q(MyPackage);
use Video::Info;
$MyPackage::drivers{video/x-msvideo} = avi;
return 1;
sub driver { "avi"; }
sub driver_new {
my($class, %args) = @_;
die "file is a required parameter for $args{mime_type} files"
unless($args{file});
$args{info} = Video::Info->new(-file => $args{file})
or die "Failed to create a Video::Info object for $args{file}";
return $class->SUPER::driver_new(%args);
}
sub duration {
my $self = shift;
return $args{info}->duration;
}
package MyPackage::mp3;
use base q(MyPackage);
use MP3::Info;
$MyPackage::drivers{audio/mpeg} = mp3;
## (etc...)
package main;
my $foo = MyPackage->new(file => foobar.mp3, mime_type => audio/mpeg);
print "foobar.mp3 is ", $foo->duration, " seconds long.n";
Download (0.011MB)
Added: 2006-11-14 License: Perl Artistic License Price:
1075 downloads
Class::AbstractLogic 0.01_01
Class::AbstractLogic is a Perl module to handle Logic Abstractions. more>>
Class::AbstractLogic is a Perl module to handle Logic Abstractions.
SYNOPSIS
# the logic class definition
package My::Logic::Foo;
use Class::AbstractLogic-base;
# a logic action
action add,
needs [qw(a b)],
verify { a => sub { /^d+$/ }, b => sub { /^d+$/ } },
sub { $_{a} + $_{b} };
1;
...
# logic module manager creation
use Class::AbstractLogic;
my $calm = Class::AbstractLogic::Manager->new;
# loading a logic class
$calm->load_logic(Foo => My::Logic::Foo);
# requesting a result from a logic method
my $result = $calm->logic(Foo)->add(a => 11, b => 12);
# $result will be false if an exception was caught
if ($result) {
print result was . $result->value . "n";
}
else {
print exception raised: . $result->key . "n";
print error message: . $result->error . "n";
}
<<lessSYNOPSIS
# the logic class definition
package My::Logic::Foo;
use Class::AbstractLogic-base;
# a logic action
action add,
needs [qw(a b)],
verify { a => sub { /^d+$/ }, b => sub { /^d+$/ } },
sub { $_{a} + $_{b} };
1;
...
# logic module manager creation
use Class::AbstractLogic;
my $calm = Class::AbstractLogic::Manager->new;
# loading a logic class
$calm->load_logic(Foo => My::Logic::Foo);
# requesting a result from a logic method
my $result = $calm->logic(Foo)->add(a => 11, b => 12);
# $result will be false if an exception was caught
if ($result) {
print result was . $result->value . "n";
}
else {
print exception raised: . $result->key . "n";
print error message: . $result->error . "n";
}
Download (0.016MB)
Added: 2007-08-01 License: Perl Artistic License Price:
814 downloads
Class::Inner 0.1
Class::Inner is a perlish implementation of Java like inner classes. more>>
Class::Inner is a perlish implementation of Java like inner classes.
SYNOPSIS
use Class::Inner;
my $object = Class::Inner->new(
parent => ParentClass,
methods => { method => sub { ... } }, },
constructor => new,
args => [@constructor_args],
);
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent classs method.
METHODS
new HASH
Takes a hash like argument list with the following keys.
parent
The name of the parent class. Note that you can only get single inheritance with this or SUPER wont work.
methods
A hash, keys are method names, values are CODEREFs.
constructor
The name of the constructor method. Defaults to new.
args
An anonymous array of arguments to pass to the constructor. Defaults to an empty list.
Returns an object in an anonymous class which inherits from the parent class. This anonymous class has a couple of extra methods:
SUPER
If you were to pass something like
$obj = Class::Inner->new(
parent => Parent,
methods => { method => sub { ...; $self->SUPER::method(@_) } },
);
then $self-gtSUPER::method almost certainly wouldnt do what you expect, so we provide the SUPER method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full SUPER:: functionality, but Im working on it.
DESTROY
Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a DESTROY method that removes the class from the symbol table once its finished with.
If you need to override a parents DESTROY method, adding a call to Class::Inner::clean_symbol_table(ref $self) to it. Do it at the end of the method or your other method calls wont work.
clean_symbol_table
The helper subroutine that DESTROY uses to remove the class from the symbol table.
new_classname
Returns a name for the next anonymous class.
<<lessSYNOPSIS
use Class::Inner;
my $object = Class::Inner->new(
parent => ParentClass,
methods => { method => sub { ... } }, },
constructor => new,
args => [@constructor_args],
);
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent classs method.
METHODS
new HASH
Takes a hash like argument list with the following keys.
parent
The name of the parent class. Note that you can only get single inheritance with this or SUPER wont work.
methods
A hash, keys are method names, values are CODEREFs.
constructor
The name of the constructor method. Defaults to new.
args
An anonymous array of arguments to pass to the constructor. Defaults to an empty list.
Returns an object in an anonymous class which inherits from the parent class. This anonymous class has a couple of extra methods:
SUPER
If you were to pass something like
$obj = Class::Inner->new(
parent => Parent,
methods => { method => sub { ...; $self->SUPER::method(@_) } },
);
then $self-gtSUPER::method almost certainly wouldnt do what you expect, so we provide the SUPER method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full SUPER:: functionality, but Im working on it.
DESTROY
Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a DESTROY method that removes the class from the symbol table once its finished with.
If you need to override a parents DESTROY method, adding a call to Class::Inner::clean_symbol_table(ref $self) to it. Do it at the end of the method or your other method calls wont work.
clean_symbol_table
The helper subroutine that DESTROY uses to remove the class from the symbol table.
new_classname
Returns a name for the next anonymous class.
Download (0.003MB)
Added: 2007-06-06 License: Perl Artistic License Price:
871 downloads
Class::DataStore 0.07
Class::DataStore is a Perl module for generic OO data storage/retrieval. more>>
Class::DataStore is a Perl module for generic OO data storage/retrieval.
SYNOPSIS
my %values = ( one => 1, two => 2 );
my $store = Class::DataStore->new( %values );
# using get/set methods
$store->set( three, 3 );
my $three = $store->get( three );
# using AUTOLOAD method
$store->four( 4 );
my $four = $store->four;
my @four = $store->four; # returns a list
my $exists = $store->exists( three ); # $exists = 1
my $data_hashref = $store->dump;
$store->clear;
Class::DataStore implements a simple storage system for object data. This data can be accessed via get/set methods and AUTOLOAD. AUTOLOAD calls are not added to the symbol table, so using get/set will be faster. Using AUTOLOAD also means that you will not be able to store data with a key that is already used by a instance method, such as "get" or "exists".
This module was written originally as part of a website framework that was used for the Democratic National Committee website in 2004. Some of the implementations here, such as get() optionally returning a list if called in array context, reflect the way this module was originally used for building web applications.
Class::DataStore is most useful when subclassed. To preserve the AUTOLOAD functionality, be sure to add the following when setting up the subclass:
use base Class::DataStore;
*AUTOLOAD = &Class::DataStore::AUTOLOAD;
This module is also a useful add-on for modules that need quick and simple data storage, e.g. to store configuration data:
$self->{_config} = Class::Datastore->new( $config_data );
sub config { return $_[0]->{_config}; }
my $server = $self->config->server;
my $sender = $self->config->get( sender );
<<lessSYNOPSIS
my %values = ( one => 1, two => 2 );
my $store = Class::DataStore->new( %values );
# using get/set methods
$store->set( three, 3 );
my $three = $store->get( three );
# using AUTOLOAD method
$store->four( 4 );
my $four = $store->four;
my @four = $store->four; # returns a list
my $exists = $store->exists( three ); # $exists = 1
my $data_hashref = $store->dump;
$store->clear;
Class::DataStore implements a simple storage system for object data. This data can be accessed via get/set methods and AUTOLOAD. AUTOLOAD calls are not added to the symbol table, so using get/set will be faster. Using AUTOLOAD also means that you will not be able to store data with a key that is already used by a instance method, such as "get" or "exists".
This module was written originally as part of a website framework that was used for the Democratic National Committee website in 2004. Some of the implementations here, such as get() optionally returning a list if called in array context, reflect the way this module was originally used for building web applications.
Class::DataStore is most useful when subclassed. To preserve the AUTOLOAD functionality, be sure to add the following when setting up the subclass:
use base Class::DataStore;
*AUTOLOAD = &Class::DataStore::AUTOLOAD;
This module is also a useful add-on for modules that need quick and simple data storage, e.g. to store configuration data:
$self->{_config} = Class::Datastore->new( $config_data );
sub config { return $_[0]->{_config}; }
my $server = $self->config->server;
my $sender = $self->config->get( sender );
Download (0.004MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1113 downloads
Class::InsideOut 1.02
Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit. more>>
Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit.
SYNOPSIS
package My::Class;
use Class::InsideOut qw( public private register id );
public name => my %name; # accessor: name()
private age => my %age; # no accessor
sub new { register( shift ) }
sub greeting {
my $self = shift;
return "Hello, my name is $name{ id $self }";
}
This is a simple, safe and streamlined toolkit for building inside-out objects. Unlike most other inside-out object building modules already on CPAN, this module aims for minimalism and robustness:
- Does not require derived classes to subclass it
- Uses no source filters, attributes or CHECK blocks
- Supports any underlying object type including black-box inheritance
- Does not leak memory on object destruction
- Overloading-safe
- Thread-safe for Perl 5.8 or better
- mod_perl compatible
- Makes no assumption about inheritance or initializer needs
It provides the minimal support necessary for creating safe inside-out objects and generating flexible accessors.
<<lessSYNOPSIS
package My::Class;
use Class::InsideOut qw( public private register id );
public name => my %name; # accessor: name()
private age => my %age; # no accessor
sub new { register( shift ) }
sub greeting {
my $self = shift;
return "Hello, my name is $name{ id $self }";
}
This is a simple, safe and streamlined toolkit for building inside-out objects. Unlike most other inside-out object building modules already on CPAN, this module aims for minimalism and robustness:
- Does not require derived classes to subclass it
- Uses no source filters, attributes or CHECK blocks
- Supports any underlying object type including black-box inheritance
- Does not leak memory on object destruction
- Overloading-safe
- Thread-safe for Perl 5.8 or better
- mod_perl compatible
- Makes no assumption about inheritance or initializer needs
It provides the minimal support necessary for creating safe inside-out objects and generating flexible accessors.
Download (0.047MB)
Added: 2006-09-27 License: Perl Artistic License Price:
1122 downloads
class.Logger.php3 1.0
class.Logger.php3 is used to maintain persistant log files in PHP3 applications as efficiently as possible. more>>
class.Logger.php3 is used to maintain persistant log files in PHP3 applications as efficiently as possible.
Using Logger, your programs can append log entries to as many different files as you need, using only 1 fopen() call and 1 fclose() call per log file.
Loggers primary use is for debugging personal programs when you cant or dont want to log via error_log().
SYNOPSIS
include("class.Logger.php3");
$logger = new Logger("/path/to/log/file/root_directory");
$logger->initialize(
array(
ERRLOG => error_log,
DEBUGLOG => debug_log
)
);
$logger->log(ERRLOG,"This is an error_log entry");
$logger->log(DEBUGLOG,"This is logged to the debug_log");
$logger->close_logs();
exit;
<<lessUsing Logger, your programs can append log entries to as many different files as you need, using only 1 fopen() call and 1 fclose() call per log file.
Loggers primary use is for debugging personal programs when you cant or dont want to log via error_log().
SYNOPSIS
include("class.Logger.php3");
$logger = new Logger("/path/to/log/file/root_directory");
$logger->initialize(
array(
ERRLOG => error_log,
DEBUGLOG => debug_log
)
);
$logger->log(ERRLOG,"This is an error_log entry");
$logger->log(DEBUGLOG,"This is logged to the debug_log");
$logger->close_logs();
exit;
Download (0.008MB)
Added: 2006-11-01 License: GPL (GNU General Public License) Price:
1088 downloads
Class::Agreement 0.02
Class::Agreement is a Perl module that add contracts to your Perl classes easily. more>>
Class::Agreement is a Perl module that add contracts to your Perl classes easily.
SYNOPSIS
package SomeClass;
use Class::Agreement;
# use base Class::Accessor or Class::MethodMaker,
# or roll your own:
sub new { ... }
invariant {
my ($self) = @_;
$self->count > 0;
};
precondition add_a_positive => sub {
my ( $self, $value ) = @_;
return ( $value >= 0 );
};
sub add_a_positive {
my ( $self, $value ) = @_;
...
}
sub choose_word {
my ( $self, $value ) = @_;
...
}
postcondition choose_word => sub {
return ( result >= 0 );
};
dependent increase_foo => sub {
my ( $self, $amount ) = @_;
my $old_foo = $self->foo;
return sub {
my ( $self, $amount ) = @_;
return ( $old_foo < $self->get_foo );
}
};
sub increase_foo {
my ( $self, $amount ) = @_;
$self->set_foo( $self->get_foo + $amount );
}
Class::Agreement is an implementation of behavioral contracts for Perl5. This module allows you to easily add pre- and postconditions to new or existing Perl classes.
This module provides contracts such as dependent contracts, contracts for higher-order functions, and informative messages when things fail.
At the time of this writing, Class::Agreement is one of only two contract implementations that blames contract-breaking components correctly. (See: "Object-oriented Programming Languages Need Well-founded Contracts" at http://citeseer.ist.psu.edu/findler01objectoriented.html.)
Using Class::Agreement lets you specify proper input and output of your functions or methods, thus strengthening your code and allowing you to spot bugs earlier.
<<lessSYNOPSIS
package SomeClass;
use Class::Agreement;
# use base Class::Accessor or Class::MethodMaker,
# or roll your own:
sub new { ... }
invariant {
my ($self) = @_;
$self->count > 0;
};
precondition add_a_positive => sub {
my ( $self, $value ) = @_;
return ( $value >= 0 );
};
sub add_a_positive {
my ( $self, $value ) = @_;
...
}
sub choose_word {
my ( $self, $value ) = @_;
...
}
postcondition choose_word => sub {
return ( result >= 0 );
};
dependent increase_foo => sub {
my ( $self, $amount ) = @_;
my $old_foo = $self->foo;
return sub {
my ( $self, $amount ) = @_;
return ( $old_foo < $self->get_foo );
}
};
sub increase_foo {
my ( $self, $amount ) = @_;
$self->set_foo( $self->get_foo + $amount );
}
Class::Agreement is an implementation of behavioral contracts for Perl5. This module allows you to easily add pre- and postconditions to new or existing Perl classes.
This module provides contracts such as dependent contracts, contracts for higher-order functions, and informative messages when things fail.
At the time of this writing, Class::Agreement is one of only two contract implementations that blames contract-breaking components correctly. (See: "Object-oriented Programming Languages Need Well-founded Contracts" at http://citeseer.ist.psu.edu/findler01objectoriented.html.)
Using Class::Agreement lets you specify proper input and output of your functions or methods, thus strengthening your code and allowing you to spot bugs earlier.
Download (0.027MB)
Added: 2007-02-28 License: Perl Artistic License Price:
968 downloads
Class::Phrasebook 0.88
Class::Phrasebook is a Perl module that implements the Phrasebook pattern. more>>
Class::Phrasebook is a Perl module that implements the Phrasebook pattern.
SYNOPSIS
use Class::Phrasebook;
my $pb = new Class::Phrasebook($log, "test.xml");
$pb->load("NL"); # using Dutch as the language
$phrase = $pb->get("ADDRESS",
{ street => "Chaim Levanon",
number => 88,
city => "Tel Aviv" } );
This class implements the Phrasebook pattern. It lets us create dictionaries of phrases. Each phrase can be accessed by a unique key. Each phrase may have placeholders. Group of phrases are kept in a dictionary. The first dictionary is the default one - which means that it will always be read. One of the dictionaries might be used to override the default one. The phrases are kept in an XML document.
<<lessSYNOPSIS
use Class::Phrasebook;
my $pb = new Class::Phrasebook($log, "test.xml");
$pb->load("NL"); # using Dutch as the language
$phrase = $pb->get("ADDRESS",
{ street => "Chaim Levanon",
number => 88,
city => "Tel Aviv" } );
This class implements the Phrasebook pattern. It lets us create dictionaries of phrases. Each phrase can be accessed by a unique key. Each phrase may have placeholders. Group of phrases are kept in a dictionary. The first dictionary is the default one - which means that it will always be read. One of the dictionaries might be used to override the default one. The phrases are kept in an XML document.
Download (0.018MB)
Added: 2006-09-19 License: Perl Artistic License Price:
1131 downloads
Class::Delegation 1.7.1
Class::Delegation is a Perl object-oriented delegation. more>>
Class::Delegation is a Perl object-oriented delegation.
SYNOPSIS
package Car;
use Class::Delegation
send => steer,
to => ["left_front_wheel", "right_front_wheel"],
send => drive,
to => ["right_rear_wheel", "left_rear_wheel"],
as => ["rotate_clockwise", "rotate_anticlockwise"]
send => power,
to => flywheel,
as => brake,
send => brake,
to => qr/.*_wheel$/,
send => halt
to => -SELF,
as => brake,
send => qr/^MP_(.+)/,
to => mp3,
as => sub { $1 },
send => -OTHER,
to => mp3,
send => debug,
to => -ALL,
as => dump,
send => -ALL,
to => logger,
;
<<lessSYNOPSIS
package Car;
use Class::Delegation
send => steer,
to => ["left_front_wheel", "right_front_wheel"],
send => drive,
to => ["right_rear_wheel", "left_rear_wheel"],
as => ["rotate_clockwise", "rotate_anticlockwise"]
send => power,
to => flywheel,
as => brake,
send => brake,
to => qr/.*_wheel$/,
send => halt
to => -SELF,
as => brake,
send => qr/^MP_(.+)/,
to => mp3,
as => sub { $1 },
send => -OTHER,
to => mp3,
send => debug,
to => -ALL,
as => dump,
send => -ALL,
to => logger,
;
Download (0.014MB)
Added: 2006-11-11 License: Perl Artistic License Price:
1077 downloads
Class::Accessor::Named 0.005
Class::Accessor::Named is a great way to automate the tedious task of generating accessors and mutators. more>>
Class::Accessor::Named is a great way to automate the tedious task of generating accessors and mutators. One small drawback is that due to the details of the implemenetation, you only get one "__ANON__" entry in profiling output.
That entry contains all your accessors, which can be a real pain if youre attempting to figure out _ w_ h_ i_ c_ h of your accessors is being called six billion times.
This module is a development aid which uses Hook::LexWrap and Sub::Name to talk your accessors into identifying themselves. While it shouldnt add much additional runtime overhead (as it acts only Class::Accessors generator functions), it has not been designed for production deployment.
<<lessThat entry contains all your accessors, which can be a real pain if youre attempting to figure out _ w_ h_ i_ c_ h of your accessors is being called six billion times.
This module is a development aid which uses Hook::LexWrap and Sub::Name to talk your accessors into identifying themselves. While it shouldnt add much additional runtime overhead (as it acts only Class::Accessors generator functions), it has not been designed for production deployment.
Download (0.020MB)
Added: 2006-09-06 License: Perl Artistic License Price:
1143 downloads
Class::CGI 0.20
Class::CGI is a Perl module to fetch objects from your CGI object. more>>
Class::CGI is a Perl module to fetch objects from your CGI object.
SYNOPSIS
use Class::CGI
handlers => {
customer_id => My::Customer::Handler
};
my $cgi = Class::CGI->new;
my $customer = $cgi->param(customer_id);
my $name = $customer->name;
my $email = $cgi->param(email); # behaves like normal
if ( my %errors = $cgi->errors ) {
# do error handling
}
For small CGI scripts, its common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.
<<lessSYNOPSIS
use Class::CGI
handlers => {
customer_id => My::Customer::Handler
};
my $cgi = Class::CGI->new;
my $customer = $cgi->param(customer_id);
my $name = $customer->name;
my $email = $cgi->param(email); # behaves like normal
if ( my %errors = $cgi->errors ) {
# do error handling
}
For small CGI scripts, its common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.
Download (0.017MB)
Added: 2006-10-20 License: Perl Artistic License Price:
1099 downloads
Class::Accessor::Fast::Contained 0.05
Class::Accessor::Fast::Contained is a Perl module for fast accessors with data containment. more>>
Class::Accessor::Fast::Contained is a Perl module for fast accessors with data containment.
SYNOPSIS
package Foo;
use base qw(Class::Accessor::Fast::Contained);
# The rest is the same as Class::Accessor::Fast
This module does two things differently to the venerable Class::Accessor::Fast :
Fields are stored at arms-length within a single hash value of $self, rather than directly in the $self blessed referent.
new() allows mixin into an existing object, rather than creating and returning a new blessed hashref. To do this, just call something like:
my $self = Some::Other::Class->new;
$self = $self->Class::Accessor::Fast::Contained::new;
Note that the mixin code only supports objects which use a blessed hash reference or a blessed typeglob reference.
An alias setup() is available which does the same as new() but might make more sense if being used in this way.
<<lessSYNOPSIS
package Foo;
use base qw(Class::Accessor::Fast::Contained);
# The rest is the same as Class::Accessor::Fast
This module does two things differently to the venerable Class::Accessor::Fast :
Fields are stored at arms-length within a single hash value of $self, rather than directly in the $self blessed referent.
new() allows mixin into an existing object, rather than creating and returning a new blessed hashref. To do this, just call something like:
my $self = Some::Other::Class->new;
$self = $self->Class::Accessor::Fast::Contained::new;
Note that the mixin code only supports objects which use a blessed hash reference or a blessed typeglob reference.
An alias setup() is available which does the same as new() but might make more sense if being used in this way.
Download (0.005MB)
Added: 2007-03-15 License: GPL (GNU General Public License) Price:
953 downloads
Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. more>>
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance.
SYNOPSIS
use Class::Maker qw(class);
class Human, { isa => [qw( ParentClass )],
public =>
{
string => [qw(name lastname)],
ref => [qw(father mother)],
array => [qw(friends)],
custom => [qw(anything)],
},
private =>
{
int => [qw(dummy1 dummy2)],
},
configure =>
{
ctor => create,
explicit => 0,
},
};
sub Human::greeting : method { my $this = shift;
printf This is %s (%d), $this->name, $this->uid;
}
class UnixUser, { isa => [qw( Human )],
public =>
{
int => [qw(uid gid)],
string => [qw(username)],
},
};
my $a = Human->new( uid => 1, gid => 2, name => Bart );
$a->father( Human->new( name => Houmer ) );
$a->greeting();
$a->uid = 12;
$a->_dummy1( bla );
Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-handlers. The classes can inherit from common perl-classes and class-maker classes. Single and multiple inheritance is supported.
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way.
Java-like reflection is also implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so one can use Tangram object-persistance on the fly as long as he uses Class::Maker classes.
<<lessSYNOPSIS
use Class::Maker qw(class);
class Human, { isa => [qw( ParentClass )],
public =>
{
string => [qw(name lastname)],
ref => [qw(father mother)],
array => [qw(friends)],
custom => [qw(anything)],
},
private =>
{
int => [qw(dummy1 dummy2)],
},
configure =>
{
ctor => create,
explicit => 0,
},
};
sub Human::greeting : method { my $this = shift;
printf This is %s (%d), $this->name, $this->uid;
}
class UnixUser, { isa => [qw( Human )],
public =>
{
int => [qw(uid gid)],
string => [qw(username)],
},
};
my $a = Human->new( uid => 1, gid => 2, name => Bart );
$a->father( Human->new( name => Houmer ) );
$a->greeting();
$a->uid = 12;
$a->_dummy1( bla );
Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-handlers. The classes can inherit from common perl-classes and class-maker classes. Single and multiple inheritance is supported.
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way.
Java-like reflection is also implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so one can use Tangram object-persistance on the fly as long as he uses Class::Maker classes.
Download (0.048MB)
Added: 2007-06-01 License: Perl Artistic License Price:
879 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above class file has wrong version 50.0 search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed