NAME
Project::Euler::Lib::Types
VERSION
Version v0.1.0
SYNOPSIS
My custom types definitions
with Project::Euler::Lib::Types qw/ (types to import) /;
SUBTYPES
PosInt
An integer greater than 0
as Int,
where {
$_ > 0
}
PosIntArray
An array of PosInts
NegInt
An integer less than 0
as Int,
where {
$_ < 0
}
NegIntArray
An array of NegInts
MyDateTime
A DateTime object parsed using DateTime::Format::Natural
my $en_parser = DateTime::Format::Natural->new(
lang => 'en',
time_zone => 'UTC',
);
class_type MyDateTime, { class => 'DateTime' };
coerce MyDateTime,
from Str,
via {
my $datetime = $en_parser->parse_datetime($_);
$en_parser->success ? $datetime : undef
};
AUTHOR
Adam Lesperance, <lespea at cpan.org>
BUGS
Please report any bugs or feature requests to bug-project-euler at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Project-Euler. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Project::Euler::Lib::Common
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2009 Adam Lesperance.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.