Elive::Util - Utility functions for Elive
$type = Elive::Util::inspect_type('Elive::Entity::Participants'); if ($type->is_array) { # ... }
Returns an object of type Elive::Util::Type.
my $password = Elive::Util::prompt('Password: ', password => 1)
Prompt for user input
print Elive::Util::string($myscalar); print Elive::Util::string($myobj); print Elive::Util::string($myref, $datatype);
Return a string for an object. This method is widely used for casting objects to ids.
If it's a simple scalar, just pass the value back.
If it's an object use the stringify method.
stringify
If it's a reference, resolve datatype to a class, and use its stringify method.
Quarter hour advancement for the Time Module impoverished.
my $start = Elive::Util::next_quarter_hour(); my $end = Elive::Util::next_quarter_hour($start);
Advance to the next quarter hour without the use of any supporting time modules. We just simply increment in seconds until localtime indicates that we're exactly on a quarter hour and ahead of the start time.
localtime
A small initial increment is added to ensure that the date remains in the future, allowing for minor gotchas such as leap seconds, general latency and smallish time drifts between the client and server.
To install Elive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elive
CPAN shell
perl -MCPAN -e shell install Elive
For more information on module installation, please visit the detailed CPAN module installation guide.