Time-Duration-Object
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Time/Duration/Object.pm view on Meta::CPAN
#pod
#pod =head2 C< new($seconds) >
#pod
#pod This returns a new Time::Duration::Object for the given number of seconds.
#pod
#pod =cut
sub new {
my ($class, $duration) = @_;
return unless defined $duration;
bless \$duration => $class;
}
#pod =head2 C< seconds >
#pod
#pod This returns the number of seconds in the duration (i.e., the argument you
#pod passed to your call to C<new>.)
#pod
#pod =cut
sub seconds {
lib/Time/Duration/Object/Infinite.pm view on Meta::CPAN
#pod =method new_positive
#pod
#pod These methods return a new Time::Duration::Object::Infinite for a positive
#pod duration.
#pod
#pod =cut
sub new_positive {
my ($class) = @_;
my $duration = 1;
bless \$duration => $class;
}
sub new { shift->new_positive }
#pod =method new_negative
#pod
#pod This returns a new Time::Duration::Object::Infinite for a negative duration.
#pod
#pod =cut
sub new_negative {
my ($class) = @_;
my $duration = -1;
bless \$duration => $class;
}
sub _is_pos { ${$_[0]} == -1 }
#pod =method new_seconds
#pod
#pod This method returns either C<+inf> or C<-inf> using Math::BigInt. (I don't
#pod recommend calling it.)
#pod
#pod =cut
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.398 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )