Main > Free Download Search >

Free classes of fire software for linux

classes of fire

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2795
Frets On Fire 1.2.438

Frets On Fire 1.2.438


Frets on Fire is a game of musical skill and fast fingers. more>>
Frets on Fire is a game of musical skill and fast fingers. Frets On Fires aim is to play guitar with the keyboard as accurately as possible.

<<less
Download (32MB)
Added: 2007-04-01 License: GPL (GNU General Public License) Price:
31275 downloads
Rauls classes for PHP 0.6.3

Rauls classes for PHP 0.6.3


Rauls classes for PHP is an OOP database abstraction layer for PHP 5.1 or greater. more>>
Rauls classes for PHP is an OOP database abstraction layer for PHP 5.1 or greater. Rauls classes for PHP provides abstract classes to access database servers and traverse result sets.
There are several implementation classes to access different types of databases: SQLite, MySQL, PostgreSQL, and MSSQL.
The classes provide functions to establish connections, execute queries, traverse result sets with pagination support, and retrieve the list of databases, tables and fields. Any possible error is signaled by throwing exceptions with specific message and error code.
Enhancements:
- A quickref.txt file was added to the project.
- A totalRows get property was included for SQL result objects.
- A third optional parameter was added to the printPageSelect method in order to return the page < select > code as an string instead of printing it.
<<less
Download (0.050MB)
Added: 2006-06-08 License: MIT/X Consortium License Price:
1235 downloads
classes::Test 0.942

classes::Test 0.942


classes::Test are functions to help with classes pragma testing. more>>
classes::Test are functions to help with classes pragma testing.

SYNOPSIS

can_new
can_set_get
has_decl
has_class_const
has_mixins
has_mixins_hash

is_classes MyClass;
is_classes main;

is_throwable X::Mine;
is_classes_exc X::Mine;

Generic tests based on Test::Builder designed to help write unit tests for code that uses the classes pragma.

<<less
Download (0.16MB)
Added: 2006-10-31 License: Perl Artistic License Price:
1088 downloads
Perl6::Classes 0.22

Perl6::Classes 0.22


Perl6::Classes project contains first class classes in Perl 5. more>>
Perl6::Classes project contains first class classes in Perl 5.

SYNOPSIS

use Perl6::Classes;

class Composer {
submethod BUILD { print "Giving birth to a new composern" }
method compose { print "Writing some music...n" }
}

class ClassicalComposer is Composer {
method compose { print "Writing some muzak...n" }
}

class ModernComposer is Composer {
submethod BUILD($) { $.length = shift }
method compose() { print((map { int rand 10 } 1..$.length), "n") }
has $.length;
}

my $beethoven = new ClassicalComposer;
my $barber = new ModernComposer 4;
my $mahler = ModernComposer->new(400);

$beethoven->compose; # Writing some muzak...
$barber->compose # 7214
compose $mahler; # 89275869347968374698756....

Perl6::Classes allows the creation of (somewhat) Perl 6-style classes in Perl 5. The following features are currently supported:

subs, methods, and submethods
And their respective scoping rules.

Attributes
Which are available through the has keyword, and look like $.this.

Inheritance
Both single and multiple inheritance are available through the is keyword.

Signatures
Signatures on methods, subs, and submethods are supported, but just the Perl 5 kind.

Data hiding
Using the public, protected, and private traits, you can enforce (run-time) data hiding. This is not supported on attributes, which are always private.

Anonymous classes
That respect closures. You can now nest them inside methods of other classes, even other anonymous ones!

The Perl6::Classes module augments Perls syntax with a new declarator: class. It offers the advantage over Perls standard OO mechanism that it is conceptually easier to see (especially for those from a C++/Java background). It offers the disadvantage, of course, of being less versatile.

<<less
Download (0.007MB)
Added: 2007-06-08 License: Perl Artistic License Price:
868 downloads
Class::Declare 0.08

Class::Declare 0.08


Class::Declare is a Perl module created to declare classes with public, private and protected attributes and methods. more>>
Class::Declare is a Perl module created to declare classes with public, private and protected attributes and methods.

SYNOPSIS

package My::Class;

use strict;
use warnings;
use base qw( Class::Declare );

__PACKAGE__->declare(

public => { public_attr => 42 } ,
private => { private_attr => Foo } ,
protected => { protected_attr => Bar } ,
class => { class_attr => [ 3.141 ] }
static => { static_attr => { a => 1 } } ,
restricted => { restricted_attr => string } ,
abstract => abstract_attr ,
friends => main::trustedsub ,
new => [ public_attr , private_attr ] ,
init => sub { # object initialisation
...
1;
} ,
strict => 0

);

sub publicmethod {
my $self = __PACKAGE__->public( shift );
...
}

sub privatemethod {
my $self = __PACKAGE__->private( shift );
...
}

sub protectedmethod {
my $self = __PACKAGE__->protected( shift );
...
}

sub classmethod {
my $self = __PACKAGE__->class( shift );
...
}

sub staticmethod {
my $self = __PACKAGE__->static( shift );
...
}

sub restrictedmethod {
my $self = __PACKAGE__->restricted( shift );
...
}

sub abstractmethod { __PACKAGE__->abstract }

1;

...

my $obj = My::Class->new( public_attr => fish );

MOTIVATION

One of Perls greatest strengths is its flexible object model. You can turn anything (so long as its a reference, or you can get a reference to it) into an object. This allows coders to choose the most appropriate implementation for each specific need, and still maintain a consistent object oriented approach.
A common paradigm for implementing objects in Perl is to use a blessed hash reference, where the keys of the hash represent attributes of the class. This approach is simple, relatively quick, and trivial to extend, but its not very secure. Since we return a reference to the hash directly to the user they can alter hash values without using the classs accessor methods. This allows for coding "short-cuts" which at best reduce the maintainability of the code, and at worst may introduce bugs and inconsistencies not anticipated by the original module author.

On some systems, this may not be too much of a problem. If the developer base is small, then we can trust the users of our modules to Do The Right Thing. However, as a modules user base increases, or the complexity of the systems our modules are embedded in grows, it may become desirable to control what users can and cant access in our module to guarantee our codes behaviour. A traditional method of indicating that an objects data and methods are for internal use only is to prefix attribute and method names with underscores. However, this still relies on the end user Doing The Right Thing.

Class::Declare provides mechanisms for module developers to explicitly state where and how their class attributes and methods may be accessed, as well as hiding the underlying data store of the objects to prevent unwanted tampering with the data of the objects and classes. This provides a robust framework for developing Perl modules consistent with more strongly-typed object oriented languages, such as Java and C++, where classes provide public, private, and protected interfaces to object and class data and methods.

<<less
Download (0.075MB)
Added: 2007-06-20 License: Perl Artistic License Price:
856 downloads
Class::Std 0.0.8

Class::Std 0.0.8


Class::Std is a Perl module to support for creating standard inside-out classes. more>>
Class::Std is a Perl module to support for creating standard "inside-out" classes.

SYNOPSIS

package MyClass;
use Class::Std;

# Create storage for object attributes...
my %name : ATTR;
my %rank : ATTR;
my %snum : ATTR;

my %public_data : ATTR;

# Handle initialization of objects of this class...
sub BUILD {
my ($self, $obj_ID, $arg_ref) = @_;

$name{$obj_ID} = check_name( $arg_ref->{name} );
$rank{$obj_ID} = check_rank( $arg_ref->{rank} );
$snum{$obj_ID} = _gen_uniq_serial_num();
}

# Handle cleanup of objects of this class...
sub DEMOLISH {
my ($self, $obj_ID) = @_;

_recycle_serial_num( $snum{$obj_ID} );
}

# Handle unknown method calls...
sub AUTOMETHOD {
my ($self, $obj_ID, @other_args) = @_;

# Return any public data...
if ( m/A get_(.*)/ ) { # Method name passed in $_
my $get_what = $1;
return sub {
return $public_data{$obj_ID}{$get_what};
}
}

warn "Cant call $method_name on ", ref $self, " object";

return; # The call is declined by not returning a sub ref
}

This module provides tools that help to implement the "inside out object" class structure in a convenient and standard way.

<<less
Download (0.030MB)
Added: 2006-09-26 License: Perl Artistic License Price:
1124 downloads
Class::Inner 0.1

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.

<<less
Download (0.003MB)
Added: 2007-06-06 License: Perl Artistic License Price:
871 downloads
Class::Meta 0.53

Class::Meta 0.53


Class::Meta is a Perl class automation, introspection, and data validation. more>>
Class::Meta is a Perl class automation, introspection, and data validation.

SYNOPSIS

Generate a class:
package MyApp::Thingy;
use strict;
use Class::Meta;
use Class::Meta::Types::String;
use Class::Meta::Types::Numeric;

BEGIN {

# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => thingy );

# Add a constructor.
$cm->add_constructor(
name => new,
create => 1,
);

# Add a couple of attributes with generated methods.
$cm->add_attribute(
name => uuid,
authz => Class::Meta::READ,
type => string,
required => 1,
default => sub { Data::UUID->new->create_str },
);
$cm->add_attribute(
name => name,
is => string,
required => 1,
default => undef,
);
$cm->add_attribute(
name => age,
is => integer,
default => undef,
);

# Add a custom method.
$cm->add_method(
name => chk_pass,
view => Class::Meta::PUBLIC,
);
$cm->build;
}
Then use the class:
use MyApp::Thingy;

my $thingy = MyApp::Thingy->new;
print "ID: ", $thingy->id, $/;
$thingy->name(Larry);
print "Name: ", $thingy->name, $/;
$thingy->age(42);
print "Age: ", $thingy->age, $/;
Or make use of the introspection API:
use MyApp::Thingy;

my $class = MyApp::Thingy->my_class;
my $thingy;

print "Examining object of class ", $class->package, $/;

print "nConstructors:n";
for my $ctor ($class->constructors) {
print " o ", $ctor->name, $/;
$thingy = $ctor->call($class->package);
}

print "nAttributes:n";
for my $attr ($class->attributes) {
print " o ", $attr->name, " => ", $attr->get($thingy), $/;
if ($attr->authz >= Class::Meta::SET && $attr->type eq string) {
$attr->get($thingy, hey there!);
print " Changed to: ", $attr->get($thingy), $/;
}
}

print "nMethods:n";
for my $meth ($class->methods) {
print " o ", $meth->name, $/;
$meth->call($thingy);
}

Class::Meta provides an interface for automating the creation of Perl classes with attribute data type validation. It differs from other such modules in that it includes an introspection API that can be used as a unified interface for all Class::Meta-generated classes. In this sense, it is an implementation of the "Facade" design pattern.

<<less
Download (0.060MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1114 downloads
Class::Bits 0.05

Class::Bits 0.05


Class::Bits is a Perl module with class wrappers around bit vectors. more>>
Class::Bits is a Perl module with class wrappers around bit vectors.

SYNOPSIS

package MyClass;
use Class::Bits;

make_bits( a => 4, # 0..15
b => 1, # 0..1
c => 1, # 0..1
d => 2, # 0..3
e => s4 # -8..7
f => s1 # -1..0
);

package;

$o=MyClass->new(a=>12, d=>2);
print "o->b is ", $o->b, "n";

print "bit vector is ", unpack("h*", $$o), "n";

$o2=$o->new();
$o3=MyClass->new($string);

ABSTRACT

Class::Bits creates class wrappers around bit vectors.

Class::Bits defines classes using bit vectors as storage.
Object attributes are stored in bit fields inside the bit vector. Bit field sizes have to be powers of 2 (1, 2, 4, 8, 16 or 32).

There is a class constructor subroutine:

make_bits( field1 => size1, field2 => size2, ...)

exports in the calling package a ctor, accessor methods, some utility methods and some constants:

Sizes can be prefixed by s or u to define signedness of the field. Default is unsigned.

$class->new()

creates a new object with all zeros.

$class->new($bitvector)

creates a new object over $bitvector.

$class->new(%fields)

creates a new object and initializes its fields with the values in %fields.

$obj->new()

clones an object.

$obj->$field()
$obj->$field($value)

gets or sets the value of the bit field $field inside the bit vector.

$class->length
$obj->lenght

returns the size in bits of the bit vector used for storage.

$class->keys
$obj->keys

returns an array with the names of the object attributes

$obj->as_hash

returns a flatten hash with the object attributes, i.e.:
my %values=$obj->as_hash;

%INDEX

hash with offsets as used by vec perl operator (to get an offset in bits, the value has to be multiplied by the corresponding bit field size).

%SIZES

hash with bit field sizes in bits.

%SIGNED

hash with signedness of the fields

Bit fields are packed in the bit vector in the order specified as arguments to make_bits.

Bit fields are padded inside the bit vector, i.e. a class created like

make_bits(A=>1, B=>2, C=>1, D=>4, E=>8, F=>16);

will have the layout

AxBBCxxx DDDDxxxx EEEEEEEE xxxxxxxx FFFFFFFF FFFFFFFF

<<less
Download (0.004MB)
Added: 2007-07-30 License: Perl Artistic License Price:
816 downloads
Class::Struct::FIELDS 1.1

Class::Struct::FIELDS 1.1


Class::Struct::FIELDS module combine Class::Struct, base and fields. more>>
Class::Struct::FIELDS module combine Class::Struct, base and fields.

SYNOPSIS

(This page documents Class::Struct::FIELDS v.1.1.)
use Class::Struct::FIELDS;
# declare struct, based on fields, explicit class name:
struct (CLASS_NAME => { ELEMENT_NAME => ELEMENT_TYPE, ... });

use Class::Struct::FIELDS;
# declare struct, based on fields, explicit class name
# with inheritance:
struct (CLASS_NAME => [qw(BASE_CLASSES ...)],
{ ELEMENT_NAME => ELEMENT_TYPE, ... });

package CLASS_NAME;
use Class::Struct::FIELDS;
# declare struct, based on fields, implicit class name:
struct (ELEMENT_NAME => ELEMENT_TYPE, ...);

package CLASS_NAME;
use Class::Struct::FIELDS;
# declare struct, based on fields, implicit class name
# with inheritance:
struct ([qw(BASE_CLASSES ...)], ELEMENT_NAME => ELEMENT_TYPE, ...);

package MyObj;
use Class::Struct::FIELDS;
# declare struct with four types of elements:
struct (s => $, a => @, h => %, x => &, c => My_Other_Class);

$obj = new MyObj; # constructor

# scalar type accessor:
$element_value = $obj->s; # element value
$obj->s (new value); # assign to element

# array type accessor:
$ary_ref = $obj->a; # reference to whole array
$ary_element_value = $obj->a->[2]; # array element value
$ary_element_value = $obj->a (2); # same thing
$obj->a->[2] = new value; # assign to array element
$obj->a (2, newer value); # same thing

# hash type accessor:
$hash_ref = $obj->h; # reference to whole hash
$hash_element_value = $obj->h->{x}; # hash element value
$hash_element_value = $obj->h (x); # same thing
$obj->h->{x} = new value; # assign to hash element
$obj->h (x, newer value); # same thing

# code type accessor:
$code_ref = $obj->x; # reference to code
$obj->x->(...); # call code
$obj->x (sub {...}); # assign to element

# regexp type accessor:
$regexp = $obj->r; # reference to code
$string =~ m/$obj->r/; # match regexp
$obj->r (qr/ ... /); # assign to element

# class type accessor:
$element_value = $obj->c; # object reference
$obj->c->method (...); # call method of object
$obj->c (My_Other_Class::->new); # assign a new object

Class::Struct::FIELDS exports a single function, struct. Given a list of element names and types, and optionally a class name and/or an array reference of base classes, struct creates a Perl 5 class that implements a "struct-like" data structure with inheritance.

The new class is given a constructor method, new, for creating struct objects.
Each element in the struct data has an accessor method, which is used to assign to the element and to fetch its value. The default accessor can be overridden by declaring a sub of the same name in the package. (See Example 2.)

Each elements type can be scalar, array, hash, code or class.

<<less
Download (0.018MB)
Added: 2007-07-11 License: Perl Artistic License Price:
835 downloads
Class::Classless 1.35

Class::Classless 1.35


Class::Classless is a Perl framework for classless OOP. more>>
Class::Classless is a Perl framework for classless OOP.

SYNOPSIS

use strict;
use Class::Classless;
my $ob1 = $Class::Classless::ROOT->clone;
$ob1->{NAME} = Ob1;
$ob1->{stuff} = 123;
$ob1->{Thing} = 789;

my $ob2 = $ob1->clone;
$ob2->{NAME} = Ob2;

printf "ob1 stuff: n", $ob1->{stuff};
printf "ob2 stuff: n", $ob2->{stuff};
printf "ob1 Thing: n", $ob1->{Thing};
printf "ob2 Thing: n", $ob2->{Thing};

$ob1->{METHODS}{zaz} = sub {
print "Zaz! on ", $_[0]{NAME}, "n";
};

$ob1->zaz;
$ob2->zaz;
$ob1->EXAMINE;
$ob2->EXAMINE;
This prints the following:
ob1 stuff: < 123 >
ob2 stuff: < 123 >
ob1 Thing: < 789 >
ob2 Thing: < >
Zaz! on Ob1
Zaz! on Ob2
< Class::Classless::X=HASH(0x200236f4) >
stuff, 123,
NAME, Ob1,
Thing, 789,
METHODS, { zaz, CODE(0x20068360) },
PARENTS, [ ROOT ],
< Class::Classless::X=HASH(0x2002cb48) >
stuff, 123,
NAME, Ob2,
METHODS, { },
PARENTS, [ Ob1 ],

In class-based OOP frameworks, methods are applicable to objects by virtue of objects belonging to classes that either provide those methods, or inherit them from classes that do.

In classless OOP frameworks (AKA delegation-and-prototypes frameworks), what methods an object is capable of is basically an attribute of that object. That is, in Perl terms: instead of methods being entries in the symbol table of the package/class the object belongs to, they are entries in a hash table inside the object. Inheritance is implemented not by having classes inheriting from other classes (via ISA lists), but by having objects inherit from other objects (via PARENTS lists).

In class-based OOP frameworks, you get new objects by calling constructors. In a classless framework, you get new objects by copying ("cloning") an existing object -- and the new clone becomes a child (inheritor) of the original object. (Where do you get the one original object? The language provides one, which has no parents, and which contains some general purpose methods like "clone".)

<<less
Download (0.023MB)
Added: 2007-07-19 License: Perl Artistic License Price:
827 downloads
Class::Container 0.12

Class::Container 0.12


Class::Container is a Perl module with Glues object frameworks together transparently. more>>
Class::Container is a Perl module with Glues object frameworks together transparently.

SYNOPSIS

package Car;
use Class::Container;
@ISA = qw(Class::Container);

__PACKAGE__->valid_params
(
paint => {default => burgundy},
style => {default => coupe},
windshield => {isa => Glass},
radio => {isa => Audio::Device},
);

__PACKAGE__->contained_objects
(
windshield => Glass::Shatterproof,
wheel => { class => Vehicle::Wheel,
delayed => 1 },
radio => Audio::MP3,
);

sub new {
my $package = shift;

# windshield and radio objects are created automatically by
# SUPER::new()
my $self = $package->SUPER::new(@_);

$self->{right_wheel} = $self->create_delayed_object(wheel);
... do any more initialization here ...
return $self;
}

This class facilitates building frameworks of several classes that inter-operate. It was first designed and built for HTML::Mason, in which the Compiler, Lexer, Interpreter, Resolver, Component, Buffer, and several other objects must create each other transparently, passing the appropriate parameters to the right class, possibly substituting other subclasses for any of these objects.

The main features of Class::Container are:

Explicit declaration of containment relationships (aggregation, factory creation, etc.)
Declaration of constructor parameters accepted by each member in a class framework
Transparent passing of constructor parameters to the class that needs them
Ability to create one (automatic) or many (manual) contained objects automatically and transparently

<<less
Download (0.019MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1113 downloads
Class::Std::Storable 0.0.1

Class::Std::Storable 0.0.1


Class::Std::Storable is a Perl module to support for creating serializable inside-out classes. more>>
Class::Std::Storable is a Perl module to support for creating serializable "inside-out" classes.

SYNOPSIS

In general, use this class exactly as you would Class::Std.

package Ice::Cream;
use Class::Std::Storable;
{
my %name_of :ATTR( :get :set );
my %flavor_of :ATTR( :get :set );
}

package main;
my $object = Ice::Cream->new;
$object->set_name("Vanilla Bean");
$object->set_flavor("vanilla");
But now, you may also serialize the object with Storable.
use Storable;
my $serialized = Storable::freeze($object);
#store to a file, database, or wherever, and retrieve later.
my $clone = Storable::thaw($serialized);

Class::Std introduced the "inside-out" model for classes (perldoc Class::Std for details). Among its salient features is complete encapsulation; that is, an objects data may only be accessed via its methods, unlike the usual hashref model that permits direct access by any code whatsoever. However, the drawback of complete encapsulation is that normal mechanisms for serialization wont work, as they rely on direct access to an objects attributes.

This class provides the class-building functionality from Class::Std, and in addition provides an interface to allow Storable to freeze and thaw any declared attributes of this class and any superclasses that were built via Class::Std::Storable.

However, in order to let Storable save attributes and construct the object, it is necessary to expose the attributes of the class to the world. Thus, any code could use the same interface that Storable does to get a copy of object attributes and create new objects with arbitrary attributes without going through the constructor. While the interface CANT be used to replace the existing attributes of an object, it COULD be used to create an arbitrarily mutated clone of an object without going through its methods. Also, if attributes are themselves references, then the objects to which they refer can be obtained and modified.

As true encapsulation is one of the major features of Class::Std, this would be a good reason NOT to use this class. But this sacrifice is required to provide serialization. You must choose which is more important for your purposes, serialization or complete encapsulation. Consider also that while bypassing the class methods is possible to a limited degree with Class::Std::Storable, doing so is much more complicated than just using the methods, so use of this class still discourages casual violations of encapsulation.

<<less
Download (0.008MB)
Added: 2007-01-15 License: Perl Artistic License Price:
1012 downloads
Class::HPLOO 0.23

Class::HPLOO 0.23


Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod. more>>
Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod.

USAGE

use Class::HPLOO ;

class Foo extends Bar , Baz {

use LWP::Simple qw(get) ; ## import the method get() to this package.

attr ( array foo_list , int age , string name , foo ) ## define attributes.

vars ($GLOBAL_VAR) ; ## same as: use vars qw($GLOBAL_VAR);

my ($local_var) ;

## constructor/initializer:
sub Foo {
$this->{attr} = $_[0] ;
}

## methods with input variables declared:
sub get_pages ($base , @pages , %options) {
my @htmls ;

if ( $options{proxy} ) { ... }

foreach my $pages_i ( @pages ) {
my $url = "$base/$pages_i" ;
my $html = get($url) ;
push(@htmls , $html) ;
$this->cache($url , $html) ;
}

return @htmls ;
}

## methos like a normal Perl sub:
sub cache {
my ( $url , $html ) = @_ ;
$this->{CACHE}{$url} = $html ;
}

sub attributes_example {
$this->set_foo_list(qw(a b c d e f)) ;
my @l = $this->get_foo_list ;

$this->set_age(30) ;
$this->set_name("Joe") ;
$this->set_foo( time() ) ;
print "NAME: ". $this->get_name ."n" ;
print "AGE: ". $this->get_age ."n" ;
print "FOO: ". $this->get_foo ."n" ;
}

}

## Example of use of the class:

package main ;

my $foo = new Foo(123) ;
$foo->get_pages(http://www.perlmonks.com/, [/index.pl,/foo] , {proxy => localhost:8080}) ;

<<less
Download (0.027MB)
Added: 2007-06-09 License: Perl Artistic License Price:
867 downloads
Class::Interfaces 0.04

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.

<<less
Download (0.006MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1115 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5