NAME
Class::Easy - make class routine easy
ABSTRACT
This module is a functionality compilation of some good modules from CPAN. Ideas are taken from Class::Data::Inheritable, Class::Accessor, Modern::Perl and Moose at least.
At the beginning I planned to create lightweight and feature-less drop-in alternative to Moose. Now package contains tree modules: class accessors, easy logging and timer for easy development.
SYNOPSIS
SYNOPSIS
use Class::Easy; # automatic loading of strict and warnings
has "property"; # make object accessor
has "global", global => 1; # make global accessor
# make subroutine in package main
make_accessor ('main', 'initialize', default => sub {
$::initialized = 1;
return "initialized!";
});
# string "[PID] [PACKAGE(STRING)] [DBG] something" logged
# only if $Class::Easy::DEBUG = 'immediately';
debug "something";
# BEWARE! all timer operations are calculated only
# when $Class::Easy::DEBUG has true value for
# easy distinguishing between debug and production
my $t = timer ('long operation');
# … long operation
my $time = $t->lap ('another long op');
# …
$time = $t->end;
# $time contains time between last 'lap' or 'timer'
# and 'end' call
$time = $t->total;
# now $time contains total time between timer init
# and end call
FUNCTIONS
has
create accessor in current scope
make_accessors
create accessor in selected scope
AUTHOR
Ivan Baktsheev, <apla at the-singlers.us>
BUGS
Please report any bugs or feature requests to my email address, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Easy. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2008-2009 Ivan Baktsheev
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 236:
Non-ASCII character seen before =encoding in '…'. Assuming UTF-8